MySQL练习

https://www.cnblogs.com/qluzzh/p/10782993.html

 

https://blog.csdn.net/flycat296/article/details/63681089

建表语句:

 1 use choujiang;
 2 
 3 create table Student(Sid varchar(10),Sname Nvarchar(10),Sage datetime,Ssex Nvarchar(10));
 4 insert into Student values('01' , N'赵雷' , '1990-01-01' , N'');
 5 insert into Student values('02' , N'钱电' , '1990-12-21' , N'');
 6 insert into Student values('03' , N'孙风' , '1990-05-20' , N'');
 7 insert into Student values('04' , N'李云' , '1990-08-06' , N'');
 8 insert into Student values('05' , N'周梅' , '1991-12-01' , N'');
 9 insert into Student values('06' , N'吴兰' , '1992-03-01' , N'');
10 insert into Student values('07' , N'郑竹' , '1989-07-01' , N'');
11 insert into Student values('08' , N'王菊' , '1990-01-20' , N'');
12 
13 create table Course(Cid varchar(10),Cname Nvarchar(10),Tid varchar(10));
14 insert into Course values('01' , N'语文' , '02');
15 insert into Course values('02' , N'数学' , '01');
16 insert into Course values('03' , N'英语' , '03');
17 
18 create table Teacher(Tid varchar(10),Tname Nvarchar(10));
19 insert into Teacher values('01' , N'张三');
20 insert into Teacher values('02' , N'李四');
21 insert into Teacher values('03' , N'王五');
22 
23 create table SC(Sid varchar(10),Cid varchar(10),score decimal(18,1));
24 insert into SC values('01' , '01' , 80);
25 insert into SC values('01' , '02' , 90);
26 insert into SC values('01' , '03' , 99);
27 insert into SC values('02' , '01' , 70);
28 insert into SC values('02' , '02' , 60);
29 insert into SC values('02' , '03' , 80);
30 insert into SC values('03' , '01' , 80);
31 insert into SC values('03' , '02' , 80);
32 insert into SC values('03' , '03' , 80);
33 insert into SC values('04' , '01' , 50);
34 insert into SC values('04' , '02' , 30);
35 insert into SC values('04' , '03' , 20);
36 insert into SC values('05' , '01' , 76);
37 insert into SC values('05' , '02' , 87);
38 insert into SC values('06' , '01' , 31);
39 insert into SC values('06' , '03' , 34);
40 insert into SC values('07' , '02' , 89);
41 insert into SC values('07' , '03' , 98);

 

posted @ 2020-07-31 11:33  Freud领工资也用券  阅读(128)  评论(0编辑  收藏  举报