Android原生SQLite常用SQL语句
创建表
CREATE TABLE student (id integer primary key autoincrement, name varchar(30), age integer)
复制代码
增
INSERT INTO student(name, age) VALUES("张三", 20)
复制代码
删
DELETE FROM student WHERE name=张三
复制代码
改
UPDATE student SET age=20 WHERE name=张三
复制代码
查
SELECT name FROM student WHERE age=20
复制代码
增加字段
ALTER TABLE student ADD COLUMN sex varchar(30)
复制代码
删除字段
ALTER TABLE student DROP COLUMN sex
复制代码