1、新建表格:
create table <table_name> (f1 type1,f2 type2);
create table stu (name char[20],age int);
2、删除表格
drop table <table_name>;
drop table student;
3、添加数据
insert into <table_name> values (value1,…);
insert into stu values (“zhangsan”,100);
4、查询数据
select * from <table_name>;
select * from stu;
select * from <table_name> where 表达式;
select * from stu where age<200;
sqlite> select * from stu where name=“zhangsan”;
select * from stu where age<200 and name=“zhangsan”;
5、更改数据
update <table_name> set <f1=value1>,<f2=value2> where 表达式;
update stu set age=20 where name=“lisi”;
6、删除数据
delete from <table_name> where 表达式;
delete from stu where age>80;
启用外键约束:PRAGMA foreign_keys = ON;