首先我自己建立一个sqlite3的数据库:
使用文件phone.sql
CREATE TABLE IF NOT EXISTS PHONETABLE (id integer primary key,name text ,phone_number integer); INSERT into PHONETABLE (name,phone_number) values('Jone','15901110265'); INSERT into PHONETABLE (name,phone_number) values('Jack','13811907568'); INSERT into PHONETABLE (name,phone_number) values('Jackson','15901110861'); INSERT into PHONETABLE (name,phone_number) values('Mike','13259647865'); INSERT into PHONETABLE (name,phone_number) values('Steven','13756231023'); INSERT into PHONETABLE (name,phone_number) values('Yao','15880156324');建立数据库:sqlite3 phone.db < phone.sql
CREATE TABLE IF NOT EXISTS PHONETABLE (id integer primary key,name text ,phone_number integer);
INSERT into PHONETABLE (name,phone_number) values('Jone','15901110265');
DELETE FROM phonetable where name='Jack'
UPDATE phonetable set name='Jack' where name='Jone'
查询全部: SELECT * FROM phonetable; 条件查询: SELECT *FROM phonetable where name='Jack'; SELECT *FROM phonetable where name LIKE 'J%';