0514-86177077
9:00-17:00(工作日)
1.創(chuàng)建數(shù)據(jù)庫表
--使用哪個數(shù)據(jù)庫,如果不寫這一句是默認的數(shù)據(jù)庫,也可以用鼠標選當前數(shù)據(jù)庫 use testDB --創(chuàng)建表 Create Table tablename ( --id表示字段名 --int 數(shù)據(jù)類型 --primary key 主鍵 --not null 非空 --identity(1,1)初始值是1 每次自增長1 id int primary key not null identity(1,1), --unique 唯一 name varchar(20) not null unique )
2.刪除表 Drop table 表名 3.修改表結(jié)構(gòu)
--增加列 Alter table 表名 Add 列名 類型 --刪除列 Alter table 表名 drop cloumn 列名 --修改列,修改列類型 Alter table 表名 Alter column 列名 type
標簽:東營 煙臺 南昌 石家莊 珠海 晉中 北海 咸寧
上一篇:必須會的SQL語句(一) 創(chuàng)建數(shù)據(jù)庫與刪除數(shù)據(jù)庫
下一篇:必須會的SQL語句(三) 數(shù)據(jù)插入
Copyright ? 1999-2012 誠信 合法 規(guī)范的巨人網(wǎng)絡通訊始建于2005年
蘇ICP備15040257號-8