sqlite建表语句
时间: 2023-08-11 12:07:23 浏览: 94
回答: 下面是一个使用SQLite建表的示例语句:
1. 创建DEPARTMENT表:
CREATE TABLE DEPARTMENT(
ID INT PRIMARY KEY NOT NULL,
DEPT CHAR(50) NOT NULL,
EMP_ID INT NOT NULL
);
2. 创建COMPANY表:
CREATE TABLE COMPANY(
ID INT PRIMARY KEY NOT NULL,
NAME TEXT NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR(50),
SALARY REAL
);
请注意,这些语句是使用SQLite的语法来创建表的。在DEPARTMENT表中,ID是主键,DEPT和EMP_ID是非空字段。在COMPANY表中,ID是主键,NAME和AGE是非空字段,ADDRESS和SALARY是可选字段。\[1\]\[2\]
#### 引用[.reference_title]
- *1* *2* *3* [SQLite 创建表](https://blog.csdn.net/lengyuezuixue/article/details/79149561)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文