資料庫作業(我裂開了

2021-09-27 13:49:11 字數 2897 閱讀 4154

--建立student資料庫

create

database student

onprimary

(name =

'stu'

,filename =

'd:\stu_data.mdf'

,size =

5mb,

maxsize =

500mb,

filegrowth =10%

)log on

(name =

'stu_log'

,filename =

'd:\stu_log.ldf'

,size =

3mb,

maxsize = unlimited,

filegrowth =

1mb)

--建立spj資料庫

create

database spj

onprimary

(name =

'spj_data'

,filename =

'd:\spj.mdf'

,size =

10mb,

maxsize = unlimited,

filegrowth =10%

)log on

(name =

'spj_log'

,filename =

'd:\spj.ldf'

,size =

1mb,

maxsize =

50mb,

filegrowth =

1mb)

use spj

create

table s

(sno char(8

)primary

key,

sname char(10

),status

char(8

),city char(10

))create

table p

(pno char(8

)primary

key,

pname char(10

),color char(8

),weight int

)create

table j

(jno char(8

)primary

key,

jname char(10

),city char(10

))create

table spj

(sno char(8

),pno char(8

),jno char(8

),qty int

,primary

key(sno,pno,jno)

,foreign

key(sno)

references s(sno)

,foreign

key(pno)

references p(pno)

,foreign

key(jno)

references j(jno)

)--建立student表

use student

create

table student(

sno char(20

),sname char(20

),s*** char(2

),sage int

, sdept char(20

),primary

key(sno)

)--建立course表

create

table course(

cno char(4

)primary

key,

cname char(20

),cpno char(4

)foreign

keyreferences course(cno)

, ccredit int

)--建立sc表

create

table sc(

sno char(20

),cno char(4

),grade int

,foreign

key(sno)

references student(sno)

,foreign

key(cno)

references course(cno)

)--建立teachr使用者

create

user teacher for login [nt authority\system]

create

schema

"teacher"

authorization

[teacher]

create

table tea(

tno char(20

),tname char(10

),tsd char(20

),tphone char(20

),te_mail char(20

),primary

key(tno)

)--修改學生表,

alter

table student add phone char(20

);alter

table student add e_mail char(20

);/*將student表的專業屬性列資料型別改為變長字串型別,長度為20*/

alter

table student alter

column sdept char(20

);/*刪除tea表的**屬性列*/

alter

table tea drop

column tphone;

我裂開了被註冊商標 商標狀態為「註冊申請中」

程式設計客棧 www.cppcns.com 11月24日 訊息 據企查www.cppcns.com查資料顯示,月23程式設計客棧日,我www.cppcns.com裂開了 被申請註冊為商標,申請人名稱為林明海,涉及國際分類為廣告銷售 設計研究 飼料種籽 科學儀器等,目前商標狀態為 註冊申請中 據悉,我...

資料庫作業

inserted表和deleted表的結構 inserted 表用於儲存 insert 和 update 語句所影響的行的副本。在乙個插入或更新事務處理中,新建行被同時新增到 inserted 表和觸發器表中。inserted 表中的行是觸發器表中新行的副本。deleted 表用於儲存 delete...

資料庫作業

設有乙個spj資料庫,包括s,p,j,spj四個關係模式 s sno,sname,status,city p pno,pname,color,weight j jno,jname,city spj sno,pno,jno,qty 商表s由 商 sno 商姓名 sname 商狀態 status 商所在...