资源描述:
《数据库sql查询语句练习2-习题-结果》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、WORD文档可编辑现在有一教学管理系统,具体的关系模式如下:Student(no,name,sex,birthday,class)Teacher(no,name,sex,birthday,prof,depart)Course(cno,cname,tno)Score(no,cno,degree)其中表中包含如下数据:Course表:Score表:Student表:技术资料专业分享WORD文档可编辑Teacher表:根据上面描述完成下面问题:(注意:注意保存脚本,尤其是DDL和DML,以便进行数据还原)DDL
2、1.写出上述表的建表语句。命令:createtableStudent(noint,namevarchar(14),sexvarchar(2),birthdaydate,classint);createtableTeacher(noint,namevarchar(14),sexvarchar(2),birthdaydate,profvarchar(10),departvarchar(10));createtableCourse(cnovarchar(8),cnamevarchar(14),tnoint);c
3、reatetableScore(noint,cnovarchar(8),degreeint);技术资料专业分享WORD文档可编辑DML1.给出相应的INSERT语句来完成题中给出数据的插入。命令:insertintoStudentvalues(5001,'李勇','男','1987-7-22',95001);insertintoStudentvalues(5002,'刘晨','女','1987-11-15',95002);insertintoStudentvalues(5003,'王敏','女','198
4、7-10-5',95001);insertintoStudentvalues(5004,'李好尚','男','1987-9-25',95003);insertintoStudentvalues(5005,'李军','男','1987-7-17',95004);insertintoStudentvalues(5006,'范新位','女','1987-6-18',95005);insertintoStudentvalues(5007,'张霞东','女','1987-8-29',95006);insertint
5、oStudentvalues(5008,'赵薇','男','1987-6-15',95007);insertintoStudentvalues(5009,'钱民将','女','1987-6-23',95008);insertintoStudentvalues(5010,'孙俪','女','1987-9-24',95002);insertintoStudentvalues(108,'赵里','男','1987-6-15',95007);insertintoStudentvalues(109,'丘处机','男
6、','1987-6-23',95008);insertintoStudentvalues(107,'杨康','男','1987-9-24',95001);insertintoTeachervalues(1,'李卫','男','1957-11-5','教授','电子工程系');insertintoTeachervalues(2,'刘备','男','1967-10-9','副教授','math');insertintoTeachervalues(3,'关羽','男','1977-9-20','讲师','sc'
7、);insertintoTeachervalues(4,'李修','男','1957-6-25','教授','elec');insertintoTeachervalues(5,'诸葛亮','男','1977-6-15','教授','计算机系');insertintoTeachervalues(6,'殷素素','女','1967-1-5','副教授','sc');insertintoTeachervalues(7,'周芷若','女','1947-2-23','教授','sc');insertintoTeac
8、hervalues(8,'赵云','男','1980-6-13','副教授','计算机系');insertintoTeachervalues(9,'张敏','女','1985-5-5','助教','sc');insertintoTeachervalues(10,'黄蓉','女','1967-3-22','副教授','sc');insertintoTeachervalues(11,'张三','男','1967-3-22','副教