以下是 Android SQLite 中常见的数据库表操作方法:
1. 创建表:
CREATE TABLE user (
id INTEGER PRIMARY KEY,
name TEXT,
age INTEGER
);
2. 删除表:
DROP TABLE user;
3. 插入数据:
INSERT INTO user VALUES (1, 'Tom', 10);
4. 更新数据:
UPDATE user SET name = 'Bill' WHERE id = 1;
5. 查询数据:
SELECT * FROM user WHERE name = 'Bill';
6. 删除数据:
DELETE FROM user WHERE id = 1;
暂无评论