层次型数据库
树状的。1:N
网状数据库
网状的。可以通过数学方法转换成层次数据库
关系数据库
把关系数据库关系,转换成简单的二次模式
DbaseIII;foxbase;Access orcle mysql lotus sql orcle mysql sqlite3
LAmp linux apache mysql php tomcat JAVA
建立或选择数据库
sqlite3 study.db
查看数据库
.databases
退出数据库
.quit
创建表格
create table department (
INT
CHAR
TEXT
REAL
)
查看表格
.table
查看表格结构
.schema comany
查所有表格结构
.schema
删除表格
drop table department;
向表格插入内容
- insert into company (.............)values(.........................)
- insert into company values (..........................);
格式控制
.head on
.mode column
查找表格内容
select *from company
where子句
- select * from company where id= 7;
- 运算符:> < >= <= and or not like glob exists
- select * from company where age in (25,27);
- 年龄为25 或 27 岁的
- select * from companny where age between 22 and 27;
- 年龄22——27
- select * from company where age not null;
- 年龄不能为空
- select * from company where exists(select age from company wherer salary >65000);
like子语句和glob 子语句
- select * from company where name like 'P%';大小写不敏感
- select * from company where glob 'P*’;
limit语句
限制符合条件的返回量
- select * from company where age <30 limit 2;
- select * from company limit 2;
- select *from compay limit 2 offset 2;
order by 子句
asc 升序 DeSc 降序