標籤:bubuko 刪除表格 分享圖片 大小 creat erer 查看 text lob
層次型資料庫
樹狀的。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 (.............)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 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 降序
資料庫(linux)