create database study go
use study
go
create table student(
sno char(5),
sname char(10),
ssex char(2),
sage int,
sdept char(20))
insert into student values('20001','张小明','女',23,'信息系')
insert into student values('20002','n2','nan',21,'jisuanji')
insert into student values('20003','n3','nv',28,'xinxi')
insert into student values('20004','n4','nan',18,'jisuanji')
go
create table course(
cno char(2),
cname char(16),
credit decimal(2,1))
insert into course values('c1','数据库',4)
insert into course values('c2','shuxue',2.5)
insert into course values('c3','xinxixitong',4)
insert into course values('c4','yingyu',3)
create table sc(
sno char(5),
cno char(2),
grade decimal(3,0))
insert into sc values('20001','c1',91)
insert into sc values('20001','c2',92)
insert into sc values('20001','c3',93)
insert into sc values('20001','c4',94)
insert into sc values('20002','c2',81)
insert into sc values('20002','c3',80)
insert into sc values('20004','c1',70)
insert into sc values('20004','c2',71)
insert into sc values('20004','c3',72)
评论