资源描述:
《school数据库创建过程》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、createdatabaseschool
on(
name=school_data,
filename='E:school_data.mdf',
size=10mb,
maxsize=500mb,
filegrowth=10%
),
(
name=school_data2,
filename='E:school_data2.ldf',
size=2mb,
maxsize=30mb,
filegrowth=5mb
)
useschool
createtablet
(
tnovarchar(8)notnull,
tnamevarchar(10)not
2、null,
tsexvarchar(4),
tagesmallint,
tprofvarchar(10),
tsalsmallint,
tcommsmallint,
tdeptvarchar(20)
)
createtables
(
snovarchar(8)notnull,
snamevarchar(10)notnull,
ssexvarchar(4),
sagesmallint,
sdeptvarchar(20)
)
createtablec
(
cnovarchar(8)notnull,
cnamevarchar(20)notnull,
ct
3、smallint
)
createtablesc
(
snovarchar(8)notnull,
cnovarchar(8)notnull,
scoresmallint
)
朱伟(308351909)13:39:17
)
createtabletc
(
tnovarchar(8)notnull,
cnovarchar(8)notnull,
)
insertintot(tno,tname,tsex,tage,tprof,tsal,tcomm,tdept)values('t1','李力','男',47,'教授',1800,3000,'计算机')
4、insertintot(tno,tname,tsex,tage,tprof,tsal,tcomm,tdept)values('t2','王平','女',28,'讲师',850,1200,'信息')
insertintot(tno,tname,tsex,tage,tprof,tsal,tcomm,tdept)values('t3','刘伟','男',30,'讲师',1000,1200,'计算机')
insertintot(tno,tname,tsex,tage,tprof,tsal,tcomm,tdept)values('t4','张雪','女',51
5、,'教授',1900,3000,'自动化')
insertintot(tno,tname,tsex,tage,tprof,tsal,tcomm,tdept)values('t5','张兰','女',39,'副教授',1500,3000,'信息')
select*fromt
insertintos(sno,sname,ssex,sage,sdept)values('s1','赵义','女',17,'计算机')
insertintos(sno,sname,ssex,sage,sdept)values('s2','钱尔','男',18,'信息')
in
6、sertintos(sno,sname,ssex,sage,sdept)values('s3','孙珊','女',20,'信息')
insertintos(sno,sname,ssex,sage,sdept)values('s4','李思','男',21,'自动化')
insertintos(sno,sname,ssex,sage,sdept)values('s5','周武','男',19,'计算机')
insertintos(sno,sname,ssex,sage,sdept)values('s6','吴丽','女',20,'自动化')
朱伟(3
7、08351909)13:39:28
select*froms
insertintosc(sno,cno,score)values('s1','c2',85)
insertintosc(sno,cno,score)values('s1','c5',100)
insertintosc(sno,cno,score)values('s2','c5',60)
insertintosc(sno,cno,score)values('s2','c6',80)
insertintosc(sno,cno)values('s2','c7')
insertintosc(s
8、no,cno,score)values('s3','c2',70)
insertintosc(sno,cno