《数据库原理》课件创建GradeManager数据库中表的SQL脚本.docx
一创建G1.m1.eM“wiger数据座中表的SQ1.本-CreateTab1.eStudent(SnoChar(7)PrimaryKey.SnaineVarCh<r(20)No(Nu1.1.SscxChar(2)No<Nu1.1.SageSnu1.iin1.C1.noChar(5);CreateTab1.eCourse(CnoChar(I)PrimaryKey.CnamcVmChar(ZO)NotNu1.1.CreditSma1.1.ini);CreateTab1.eC1.ass<C1.noChar(5)PrimaryKey.Specia1.ityVarChart20)NotNu1.1.InycarChar(4)No<Nu1.1.Number1.nt,MonitorChaf(7);CreateTab1.eGrade(SnoChar(7)NotNu1.1.CnoChartI)NocNu1.1.GnwrkNunIeriC(4J).FOREIGNKEY(Sno)RcFERENCESStudcnt(Sno).FOREIGNKEY(Cno)RcFERENCESCounic(Cno).INSERTINTOStudcnt(Sno.Snamc.Sscx.Sagc.C1.no)VA1.UES('2(XX>!O,'y2().,(X)311*)INSEKIINTOStudcnt(Sno.Snamc.Sscx.Sage.C1.no)丫A11'20001021'刘诗晨:女.19:00311')INSERTINTOS(den(Sno5nane.Sse.,Sage.Ch>o)V1.UES('2000I037三呷;男12O*OO312')INSERTINTOS(uden(Sno,S11ame.Ssex,Sage.Cno)VA1.UESr2000104;张婷婷:女'.21,'00312)INSERTINTOStudcnt(Sno.Snamc.Sscx.Sagc.C1.no)VA1.UES('2(X)110/'19)131)INSERTINTOStudcnt(Sno.Snamc.Sscx.Sagc.C1.no)VA1.UESr200】1021比向东INSEKINTOStudcnt(Sno.Sname.Sscx.Sagc.C1.no)VA1.UES('20011O3V2EV¾'.2O.!31.)INSERTINTOS(udem(Sw5nane.Sse,Sage.Cno)V1.UES(,2001104;张逸凡P男;21:013Ir)INSERTINTOCoursc(Cno.Cnamc.Crcdit)VA1.UES(T;数据库INSERTINTOCoursc(Cno.Cnamc.Crcdit)VA1.UESC2T离口数学V3)INSEKI'INTOCou11ic(Cno.Cnamc.Crcdit)VA1.UESr3'管理佶息系统V2')INSERTINTOCour(Cno.Cnarne.Cnx1.i()VA1.UES(H,'操作系统'W)INSERTINTOCourse(Cho,CnametCrediOVA1.UES(S'数据结构'W)INSERTINTOCoursc(Cno.Cnamc.Crcdit)VA1.UES('6.'数据处理.2)INSEK1NTOCou11ic(Cno.Cnamc.Crcdit)VA1.UES(,7,C语V4,)INSERTINTOGradC(Sno.Cno.Gmark)VA1.UES200010二T.92)INSERTINTOGrade(SnoCnoQgrk)VA1.UES(,2OIOV3',NU1.1.)INSERTINTOGnIde(SndCnoGWk)VA1.UESr20(K)IOr3.86)INSERIINTOGraddS11o.Cno.Gmark)VA1.UESC2000102.,.78)INSERTINTO(iraddSno.Cno.Gmark)VA1.UES(ZO(X)102:6,55)INSERTIKTOGrade(SnoCnoOmark)VAI.UES('2OIO3,'3'.65)INSERTINTOGraddSno.Cno.G三k)VA1.UES(2000103',6,78)INSERTINTOGnidc(SnoCnoXimark)VA1.UESC2000047.54)INSERTINTOGradc(Sno.Cno.Gmark)VA1.UESc200010416.83)INSERTINTOGrade(Sno,Cno.G三rk)VA1.UES2OOIIO.'2,.7)INSERTINTOGrade(S11o.Cno.G三k)VA1.UESC200110.'4',65)INSEKINTOGradc(Sno1Cno1Gmark)VA1.UESC2001.IO2,.,2.8O)INSER1.INTOGraddSnoCnoCmark)VA1.UES(2()()110274.9()INSERT1.N11)GraddSno-Cno.Gmark)VA1.UESr2001102'6'.83)INSERTINTOGraddSno1Ciw1.Gmafk)VA1.UES(2001103'.'4',76)INSERTINTOGrade<Sno.C>o.Gnwrk)VA1.UES(7001.103,6,56)INSERTIKTOc1.ass(c1.no,s>ecia1.ity.inyear,number.monitor)VA1.UES('003ir,'计算机软件'2XM)',120,'2000101')INSERTINTOc1.ass(c1.no.specia1.i(y.inyear.nuniber.nioni(or)VA1.UES('00312;计灯机应用件''2000',140,'2000103')INSERTINTOc1.ass(c1.no,spccia1.ity.inycar.nunibcr.moniU»r)Va1.uesco13r;计JZi1.KfK'2ooi'.22.2o3,)