当前位置:Gxlcms > 数据库问题 > 2017-3-10 SQL server 数据库 T--SQL语句

2017-3-10 SQL server 数据库 T--SQL语句

时间:2021-07-01 10:21:17 帮助过:11人阅读

:create datebase  数据库名     注:数据库名不能为中文,不能数字开头,不能符号开头。

删除数据库:drop datebase 数据库名

创建表:create   table  表名

    (列名  数据类型,

      ......

 

         设置主键列:primary key

     设置唯一列:unique

    设置非空: not null

    设置自增列:identity (1,1)  从1开始计数,每次自增1

     )

删除表:drop table 表名

添加列:alter table 表名 add 列名  数据类型

删除列:alter table 表名 drop column 列名

添加数据:insert into 表名 values(‘s002‘,‘1987-2-3‘,‘true‘,96)

修改数据:update 表名 set 列名 =值

删除数据:delete  from 表名 /truncate table 表名

查询数据:select * from 表名

2017-3-10 SQL server 数据库 T--SQL语句

标签:update   column   delete   null   删除表   alt   value   alter   values   

人气教程排行