Modification Statements

SQL provides a number of statements that let you insert, delete, and update records in the database. For example, to add a few phone numbers, you could use this:

Download SQLite/insert.sql

insert into mytable values(null, 'Steven King', '555-1212');

insert into mytable values(null, 'John Smith', '555-2345');

insert into mytable values(null, 'Fred Smitheizen', '555-4321');

The values are specified in the same order you used in the CREATE TABLE statement. We specify NULL for _id because SQLite will figure that value out for us.

0 0

Post a comment