4.SQL–创建成绩表和向表内插入数据

--创建成绩表,并向表内插入数据

create table SC(Scid varchar(10),Cid varchar(10),score decimal(18,1))

--向表内插入数据

insert into SC values(‘01‘ , ‘01‘ , 80)

insert into SC values(‘01‘ , ‘02‘ , 90)

insert into SC values(‘01‘ , ‘03‘ , 99)

insert into SC values(‘02‘ , ‘01‘ , 70)

insert into SC values(‘02‘ , ‘02‘ , 60)

insert into SC values(‘02‘ , ‘03‘ , 80)

insert into SC values(‘03‘ , ‘01‘ , 80)

insert into SC values(‘03‘ , ‘02‘ , 80)

insert into SC values(‘03‘ , ‘03‘ , 80)

insert into SC values(‘04‘ , ‘01‘ , 50)

insert into SC values(‘04‘ , ‘02‘ , 30)

insert into SC values(‘04‘ , ‘03‘ , 20)

insert into SC values(‘05‘ , ‘01‘ , 76)

insert into SC values(‘05‘ , ‘02‘ , 87)

insert into SC values(‘05‘ , ‘03‘ , 88)

insert into SC values(‘06‘ , ‘01‘ , 31)

insert into SC values(‘06‘ , ‘03‘ , 34)

insert into SC values(‘07‘ , ‘02‘ , 89)

insert into SC values(‘07‘ , ‘03‘ , 98)

insert into SC values(‘08‘ , ‘01‘ , 90)

insert into SC values(‘08‘ , ‘02‘ , 88)

相关文章