表结构脚本:
CREATE TABLE Student
(
no int(50) not null PRIMARY key, -- 学号
name VARCHAR(50) not null, -- 学生姓名
sex VARCHAR(50) not null, -- 性别
birthday VARCHAR(50) not null, -- 生日
class VARCHAR(50) not null -- 班级
)
CREATE TABLE Teacher
(
no int(50) not null PRIMARY key, -- 教师编号
name VARCHAR(50) not null, -- 教师姓名
sex VARCHAR(50) not null, -- 教师性别
birthday datetime, -- 教师生日
prof VARCHAR(50) not null, -- 职位
depart VARCHAR(50) not null -- 系别
)
CREATE TABLE Course
(
cno VARCHAR(50) not null PRIMARY key, -- 课程编号
cname VARCHAR(50) not null, -- 课程
tno int(50) not null -- 教师编号
)
CREATE TABLE Score
(
no int(50) not null , -- 学号
cno VARCHAR(50) not null, -- 课程编号
degree int(50) not null -- 成绩
)
DROP TABLE Score;
INSERT INTO course VALUES ('3-101','数据库',1);
INSERT INTO course VALUES ('5-102','数学',3);
INSERT INTO course VALUES ('3-103','信息系统',4);
INSERT INTO course VALUES ('3-104','操作系统',6);
INSERT INTO course VALUES ('3-105','数据结构',4);
INSERT INTO course VALUES ('3-106','数据处理',5);
INSERT INTO course VALUES ('4-107','pascal语言',5);
INSERT INTO course VALUES ('4-108','c++',7);
INSERT INTO course VALUES ('4-109','java',8);
INSERT INTO course VALUES ('3-245','数据挖掘',10);
INSERT INTO course VALUES ('3-111','软件工程',11);
INSERT INTO score VALUES(5001,'3-105',69);
INSERT INTO score VALUES(5001,'5-102',55);
INSERT INTO score VALUES(5003,'4-108',85);
INSERT INTO score VALUES(5004,'3-105',77);
INSERT INTO score VALUES(5005,'3-245',100);
INSERT INTO score VALUES(5006,'3-105',53);
INSERT INTO score VALUES(5003,'4-109',45);
INSERT INTO score VALUES(5008,'3-105',98);
INSERT INTO score VALUES(5004,'4-109',68);
INSERT INTO score VALUES(5010,'3-105',88);
INSERT INTO score VALUES(5003,'3-105',98