创建表:
用create语句可以在数据库中创建表
create table student(
ID INTEGER,
name TEXT,
sex TEXT,
age INTEGER,
primary key(ID)
);
SQLite中的数据类型:
NULL -- The value is a NULL value.
INTEGER -- The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.
REAL -- The value is a floating point value, stored as an 8-byte IEEE floating point number.
TEXT -- The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).
BLOB -- The value is a blob of data, stored exactly as it was input.
删除表:
用drop语句可以从数据库中删除指定的表
drop table student;
表被删除后,表中所存储的数据将全部丢弃。
Linux - C数据库编程(预习内容二)
最新推荐文章于 2023-11-26 20:08:30 发布