《SQL語句大全》

2021-08-29 08:11:25 字數 436 閱讀 4278

--語 句 功 能

--資料操作

select --從資料庫表中檢索資料行和列

insert --向資料庫表新增新資料行

delete --從資料庫表中刪除資料行

update --更新資料庫表中的資料

--資料定義

create table --建立乙個資料庫表

drop table --從資料庫中刪除表

alter table --修改資料庫表結構

create view --建立乙個檢視

drop view --從資料庫中刪除檢視

create index --為資料庫表建立乙個索引

drop index --從資料庫中刪除索引

create procedure --建立乙個儲存過程

drop procedure --從資料庫中刪……

SQL語句大全

建表 create table tab1 id counter,name string,age integer,date datetime 技巧 自增字段用 counter 宣告.欄位名為關鍵字的字段用方括號括起來,數字作為欄位名也可行.建立索引 下面的語句在tab1的date列上建立可重複索引 c...

習SQL語句之SQL語句大全

語 句 功 能 資料操作 select 從資料庫表中檢索資料行和列 insert 向資料庫表新增新資料行 delete 從資料庫表中刪除資料行 update 更新資料庫表中的資料 資料定義 create table 建立乙個資料庫表 drop table 從資料庫中刪除表 alter table 修...

SQL語句大全 技巧

三 技巧 1 1 1,1 2的使用,在sql語句組合時用的較多 where 1 1 是表示選擇全部 where 1 2 全部不選,如 if strwhere begin set strsql select count as total from tblname where strwhere ende...