This sample illustrates use of INSERT statement.
This SQL script contains nine queries.
First one deletes table named "developers".
The second creates this table with 3 fields.
Queries 3-8 insert some data into the table.
The ninth query retrieves all rows from this table.
Notice that you don't have to specify column names as long as you let parameters follow the order of columns in the table (line 6).
drop table developers;
create table developers (id AutoInc, code Integer, name varchar(20));
insert into developers (code, name) values (5, 'Bob');
insert into developers (code, name) values (7, 'Jeck');
insert into developers (code, name) values (2, 'Carol');
insert into developers values (10, 5, 'Harry');
insert into developers (code, name) values (4, 'Sam');
insert into developers (code, name) values (9, 'Chris');
select * from developers order by name desc, code, id;
Download Absolute Database | Learn more |