日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

SQL Server 相关create操作语句

發布時間:2023/12/10 数据库 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SQL Server 相关create操作语句 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

創建數據庫:

create database jylt

on (

??? name=jylt,

??? filename='e:\db\jylt.mdf',

??? size=4,

??? filegrowth=100%,

??? maxsize=1024?

)

log on

(

??? name=jylt_log,

??? filename='e:\db\jylt_log.ldf',

??? size=4,

??? filegrowth=100%

)

go

?

1,增:insert into t_user values('wangpeng','19');s

2,刪:delete from t_user where t_user.age<30

3,改:update t_user? name='xiaohong' where name='dahong'

4,查:select name as '名字' age as '年齡' from t_user where name='xiaohong'

?

?

?

?

check約束: age between 18 and 70 and gongzi 1000 and 3000

?

?

use master

go

create database jylt

on (

??? name=jylt,

??? filename='e:\db\jylt.mdf',

??? size=4,

??? filegrowth=100%,

??? maxsize=1024)

log on(

??? name=jylt_log,

??? filename='e:\db\jylt_log.ldf',

??? size=4,

??? filegrowth=100%)

go

use jylt

go

create table t_user

(

??? uid int primary key identity(1,1) not null,

??? ulname varchar(50) not null,

??? ulpwd varchar(50) not null,

??? unichen varchar(50) null,

??? uname varchar(50) null,

??? uaddress varchar(200) null,

??? usex int ,

??? utelephone varchar(50) null,

??? uhomepage varchar(200) null,

??? uimageurl varchar(200) null,

??? usignature varchar(200) null

)

go

create table t_reply

(

??? rid int not null primary key,

??? uid int foreign key references t_user(uid) ,

??? rtitle varchar(50),

??? rcontent varchar(max) not null,

??? rdatetime datetime default getdate()

)

go

create table t_board

(

??? bid int primary key not null,

??? bname varchar(50) not null,

??? bimgurl varchar(200) null,

??? binfo varchar(200) null

)

go

create table t_topic

(

??? tid int primary key not null,

??? ttitle varchar(50) not null,

??? tcontent varchar(max) not null,

??? tdatetime datetime default getdate(),

??? uid int foreign key references t_user(uid),

??? tview int default 0,

??? bid int references t_board(bid)

)

go

轉載于:https://www.cnblogs.com/netact/archive/2010/07/06/1771874.html

總結

以上是生活随笔為你收集整理的SQL Server 相关create操作语句的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。