个人原创,请勿转载
以下为数据库系统概念书中的sql数据,可以用来配套学习,经过mysql 5.7版本验证可以使用
create table classroom (building varchar(15), room_number varchar(7), capacity numeric(4,0), primary key (building, room_number) ); create table department( dept_name varchar(20), buiding varchar(15), budget numeric(12,2), primary key (dept_name) ); CREATE TABLE `demoDB`.`course` ( `course_id` VARCHAR(7) NOT NULL, `title` VARCHAR(50) NULL, `credits` DECIMAL(2,0) NULL, `dept_name` VARCHAR(20) NULL, PRIMARY KEY (`course_id`), INDEX `dept_name_idx` (`dept_name` ASC), CONSTRAINT `dept_name` FOREIGN KEY (`dept_name`) REFERENCES `demoDB`.`department` (`dept_name`) ON DELETE NO ACTION ON UPDATE NO ACTION); create table course( course_id varchar(7), title varchar(50), dept_name varchar(20), credits numeric(2,0), primary key(course_id), CONSTRAINT `dept_name` FOREIGN KEY (`dept_name`) REFERENCES `demoDB`.`department` (`dept_name`) ); create table instructor( ID varchar(5), name varchar(20) not null, dept_name varchar(20), salary numeric(8,2), primary key (ID), FOREIGN KEY (`dept_name`) REFERENCES `demoDB`.`department` (`dept_name`) ); create table section( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4), primary key (course_id,sec_id,semester,year), foreign key(course_id)references `course`(course_id) ); create table teaches( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), primary key(ID,course_id,sec_id,semester,year), foreign key(course_id,sec_id,semester,year)references `demoDB`.`section`(course_id,sec_id,semester,year), foreign key(ID) references `instructor`(ID) ); create table student (ID varchar(5), name varchar(20) not null, dept_name varchar(20), tot_cred numeric(3,0) check (tot_cred >= 0), primary key (ID), foreign key (dept_name) references department(dept_name) on delete set null ); create table takes (ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2), primary key (ID, course_id, sec_id, semester, year), foreign key (course_id,sec_id, semester, year) references `section`(course_id,sec_id, semester, year) on delete cascade, foreign key (ID) references `student`(ID) on delete cascade ); create table advisor (s_ID varchar(5), i_ID varchar(5), primary key (s_ID), foreign key (i_ID) references instructor (ID) on delete set null, foreign key (s_ID) references student (ID) on delete cascade ); create table time_slot (time_slot_id varchar(4), day varchar(1), start_hr numeric(2) check (start_hr >= 0 and start_hr < 24), start_min numeric(2) check (start_min >= 0 and start_min < 60), end_hr numeric(2) check (end_hr >= 0 and end_hr < 24), end_min numeric(2) check (end_min >= 0 and end_min < 60), primary key (time_slot_id, day, start_hr, start_min) ); create table prereq (course_id varchar(8), prereq_id varchar(8), primary key (course_id, prereq_id), foreign key (course_id) references course(course_id) on delete cascade, foreign key (prereq_id) references course(course_id) ); insert into classroom values ('Packard', '101', '500'); insert into classroom values ('Painter', '514', '10'); insert into classroom values ('Taylor', '3128', '70'); insert into classroom values ('Watson', '100', '30'); insert into classroom values ('Watson', '120', '50'); insert into department values ('Biology', 'Watson', '90000'); insert into department values ('Comp. Sci.', 'Taylor', '100000'); insert into department values ('Elec. Eng.', 'Taylor', '85000'); insert into department values ('Finance', 'Painter', '120000'); insert into department values ('History', 'Painter', '50000'); insert into department values ('Music', 'Packard', '80000'); insert into department values ('Physics', 'Watson', '70000'); insert into course values ('BIO-101', 'Intro. to Biology', 'Biology', '4'); insert into course values ('BIO-301', 'Genetics', 'Biology', '4'); insert into course values ('BIO-399', 'Computational Biology', 'Biology', '3'); insert into course values ('CS-101', 'Intro. to Computer Science', 'Comp. Sci.', '4'); insert into course values ('CS-190', 'Game Design', 'Comp. Sci.', '4'); insert into course values ('CS-315', 'Robotics', 'Comp. Sci.', '3'); insert into course values ('CS-319', 'Image Processing', 'Comp. Sci.', '3'); insert into course values ('CS-347', 'Database System Concepts', 'Comp. Sci.', '3'); insert into course values ('EE-181', 'Intro. to Digital Systems', 'Elec. Eng.', '3'); insert into course values ('FIN-201', 'Investment Banking', 'Finance', '3'); insert into course values ('HIS-351', 'World History', 'History', '3'); insert into course values ('MU-199', 'Music Video Production', 'Music', '3'); insert into course values ('PHY-101', 'Physical Principles', 'Physics', '4'); insert into instructor values ('10101', 'Srinivasan', 'Comp. Sci.', '65000'); insert into instructor values ('12121', 'Wu', 'Finance', '90000'); insert into instructor values ('15151', 'Mozart', 'Music', '40000'); insert into instructor values ('22222', 'Einstein', 'Physics', '95000'); insert into instructor values ('32343', 'El Said', 'History', '60000'); insert into instructor values ('33456', 'Gold', 'Physics', '87000'); insert into instructor values ('45565', 'Katz', 'Comp. Sci.', '75000'); insert into instructor values ('58583', 'Califieri', 'History', '62000'); insert into instructor values ('76543', 'Singh', 'Finance', '80000'); insert into instructor values ('76766', 'Crick', 'Biology', '72000'); insert into instructor values ('83821', 'Brandt', 'Comp. Sci.', '92000'); insert into instructor values ('98345', 'Kim', 'Elec. Eng.', '80000'); insert into section values ('BIO-101', '1', 'Summer', '2009', 'Painter', '514', 'B'); insert into section values ('BIO-301', '1', 'Summer', '2010', 'Painter', '514', 'A'); insert into section values ('CS-101', '1', 'Fall', '2009', 'Packard', '101', 'H'); insert into section values ('CS-101', '1', 'Spring', '2010', 'Packard', '101', 'F'); insert into section values ('CS-190', '1', 'Spring', '2009', 'Taylor', '3128', 'E'); insert into section values ('CS-190', '2', 'Spring', '2009', 'Taylor', '3128', 'A'); insert into section values ('CS-315', '1', 'Spring', '2010', 'Watson', '120', 'D'); insert into section values ('CS-319', '1', 'Spring', '2010', 'Watson', '100', 'B'); insert into section values ('CS-319', '2', 'Spring', '2010', 'Taylor', '3128', 'C'); insert into section values ('CS-347', '1', 'Fall', '2009', 'Taylor', '3128', 'A'); insert into section values ('EE-181', '1', 'Spring', '2009', 'Taylor', '3128', 'C'); insert into section values ('FIN-201', '1', 'Spring', '2010', 'Packard', '101', 'B'); insert into section values ('HIS-351', '1', 'Spring', '2010', 'Painter', '514', 'C'); insert into section values ('MU-199', '1', 'Spring', '2010', 'Packard', '101', 'D'); insert into section values ('PHY-101', '1', 'Fall', '2009', 'Watson', '100', 'A'); insert into teaches values ('10101', 'CS-101', '1', 'Fall', '2009'); insert into teaches values ('10101', 'CS-315', '1', 'Spring', '2010'); insert into teaches values ('10101', 'CS-347', '1', 'Fall', '2009'); insert into teaches values ('12121', 'FIN-201', '1', 'Spring', '2010'); insert into teaches values ('15151', 'MU-199', '1', 'Spring', '2010'); insert into teaches values ('22222', 'PHY-101', '1', 'Fall', '2009'); insert into teaches values ('32343', 'HIS-351', '1', 'Spring', '2010'); insert into teaches values ('45565', 'CS-101', '1', 'Spring', '2010'); insert into teaches values ('45565', 'CS-319', '1', 'Spring', '2010'); insert into teaches values ('76766', 'BIO-101', '1', 'Summer', '2009'); insert into teaches values ('76766', 'BIO-301', '1', 'Summer', '2010'); insert into teaches values ('83821', 'CS-190', '1', 'Spring', '2009'); insert into teaches values ('83821', 'CS-190', '2', 'Spring', '2009'); insert into teaches values ('83821', 'CS-319', '2', 'Spring', '2010'); insert into teaches values ('98345', 'EE-181', '1', 'Spring', '2009'); insert into student values ('00128', 'Zhang', 'Comp. Sci.', '102'); insert into student values ('12345', 'Shankar', 'Comp. Sci.', '32'); insert into student values ('19991', 'Brandt', 'History', '80'); insert into student values ('23121', 'Chavez', 'Finance', '110'); insert into student values ('44553', 'Peltier', 'Physics', '56'); insert into student values ('45678', 'Levy', 'Physics', '46'); insert into student values ('54321', 'Williams', 'Comp. Sci.', '54'); insert into student values ('55739', 'Sanchez', 'Music', '38'); insert into student values ('70557', 'Snow', 'Physics', '0'); insert into student values ('76543', 'Brown', 'Comp. Sci.', '58'); insert into student values ('76653', 'Aoi', 'Elec. Eng.', '60'); insert into student values ('98765', 'Bourikas', 'Elec. Eng.', '98'); insert into student values ('98988', 'Tanaka', 'Biology', '120'); insert into takes values ('00128', 'CS-101', '1', 'Fall', '2009', 'A'); insert into takes values ('00128', 'CS-347', '1', 'Fall', '2009', 'A-'); insert into takes values ('12345', 'CS-101', '1', 'Fall', '2009', 'C'); insert into takes values ('12345', 'CS-190', '2', 'Spring', '2009', 'A'); insert into takes values ('12345', 'CS-315', '1', 'Spring', '2010', 'A'); insert into takes values ('12345', 'CS-347', '1', 'Fall', '2009', 'A'); insert into takes values ('19991', 'HIS-351', '1', 'Spring', '2010', 'B'); insert into takes values ('23121', 'FIN-201', '1', 'Spring', '2010', 'C+'); insert into takes values ('44553', 'PHY-101', '1', 'Fall', '2009', 'B-'); insert into takes values ('45678', 'CS-101', '1', 'Fall', '2009', 'F'); insert into takes values ('45678', 'CS-101', '1', 'Spring', '2010', 'B+'); insert into takes values ('45678', 'CS-319', '1', 'Spring', '2010', 'B'); insert into takes values ('54321', 'CS-101', '1', 'Fall', '2009', 'A-'); insert into takes values ('54321', 'CS-190', '2', 'Spring', '2009', 'B+'); insert into takes values ('55739', 'MU-199', '1', 'Spring', '2010', 'A-'); insert into takes values ('76543', 'CS-101', '1', 'Fall', '2009', 'A'); insert into takes values ('76543', 'CS-319', '2', 'Spring', '2010', 'A'); insert into takes values ('76653', 'EE-181', '1', 'Spring', '2009', 'C'); insert into takes values ('98765', 'CS-101', '1', 'Fall', '2009', 'C-'); insert into takes values ('98765', 'CS-315', '1', 'Spring', '2010', 'B'); insert into takes values ('98988', 'BIO-101', '1', 'Summer', '2009', 'A'); insert into takes values ('98988', 'BIO-301', '1', 'Summer', '2010', null); insert into advisor values ('00128', '45565'); insert into advisor values ('12345', '10101'); insert into advisor values ('23121', '76543'); insert into advisor values ('44553', '22222'); insert into advisor values ('45678', '22222'); insert into advisor values ('76543', '45565'); insert into advisor values ('76653', '98345'); insert into advisor values ('98765', '98345'); insert into advisor values ('98988', '76766'); insert into time_slot values ('A', 'M', '8', '0', '8', '50'); insert into time_slot values ('A', 'W', '8', '0', '8', '50'); insert into time_slot values ('A', 'F', '8', '0', '8', '50'); insert into time_slot values ('B', 'M', '9', '0', '9', '50'); insert into time_slot values ('B', 'W', '9', '0', '9', '50'); insert into time_slot values ('B', 'F', '9', '0', '9', '50'); insert into time_slot values ('C', 'M', '11', '0', '11', '50'); insert into time_slot values ('C', 'W', '11', '0', '11', '50'); insert into time_slot values ('C', 'F', '11', '0', '11', '50'); insert into time_slot values ('D', 'M', '13', '0', '13', '50'); insert into time_slot values ('D', 'W', '13', '0', '13', '50'); insert into time_slot values ('D', 'F', '13', '0', '13', '50'); insert into time_slot values ('E', 'T', '10', '30', '11', '45 '); insert into time_slot values ('E', 'R', '10', '30', '11', '45 '); insert into time_slot values ('F', 'T', '14', '30', '15', '45 '); insert into time_slot values ('F', 'R', '14', '30', '15', '45 '); insert into time_slot values ('G', 'M', '16', '0', '16', '50'); insert into time_slot values ('G', 'W', '16', '0', '16', '50'); insert into time_slot values ('G', 'F', '16', '0', '16', '50'); insert into time_slot values ('H', 'W', '10', '0', '12', '30'); insert into prereq values ('BIO-301', 'BIO-101'); insert into prereq values ('BIO-399', 'BIO-101'); insert into prereq values ('CS-190', 'CS-101'); insert into prereq values ('CS-315', 'CS-101'); insert into prereq values ('CS-319', 'CS-101'); insert into prereq values ('CS-347', 'CS-101'); insert into prereq values ('EE-181', 'PHY-101');
相关推荐
在本资源中,《数据库系统概念》第六版提供了丰富的实验数据,帮助读者深入理解和应用数据库理论。这本书是数据库领域的经典之作,涵盖了数据库设计、管理、优化等多方面的知识。 SQL,全称Structured Query ...
《数据库系统概念》第六版是数据库领域的一本经典教材,由Silberschatz、Korth和Sudarshan三位作者撰写。这本书深入浅出地介绍了数据库系统的基本概念、设计原理和实现技术,对于学习和理解数据库有极大的帮助。提供...
总的来说,这个"数据库系统概念第六版SQL文件"提供了一个实践学习和理解数据库原理的平台,通过操作这些样例表,我们可以更好地掌握SQL语言,理解关系数据库的设计和管理,以及如何在实际应用中优化数据库性能。
第六版的这本书深入浅出地介绍了数据库系统的理论和实践,涵盖了从基本概念到高级特性的广泛内容。 本书主要分为以下几个关键知识点: 1. **数据库系统概述**:解释了数据库系统的基本概念,包括数据、数据库、...
课后习题是巩固学习、提升理解的关键环节,而这份“数据库系统概念第六版课后习题答案,完整版”则为读者提供了全面的解题指导。 首先,我们要了解数据库的基本概念。数据库是一个有组织的数据集合,通过数据库管理...
《数据库系统概念》第六版是一本广泛使用的教材,深入浅出地介绍了数据库的基础理论和实际应用。这本书涵盖了数据库设计、关系模型、SQL语言、事务处理、并发控制、恢复机制以及数据库安全性等关键主题。 一、...
《数据库系统概念》第六版是一本深受欢迎的数据库理论与实践教材,由S. Silberschatz、H. Korth和S. Sudarshan等知名学者撰写。这本书全面覆盖了数据库系统的各个方面,从基础概念到最新的技术发展,为读者提供了一...
《数据库系统概念》第六版是一本权威的教材,深入浅出地介绍了数据库领域的基础知识和最新发展。原版PPT合集则提供了丰富的视觉教学资源,帮助学习者更好地理解和掌握相关知识。 一、数据库系统基础 1. 数据模型:...
《数据库系统概念》是数据库领域的经典教材,第六版更是涵盖了广泛且深入的数据库知识。这份课后习题答案集合,提供了从第一章至第二十六章的解答,是学习者巩固理论、提升实践技能的重要参考资料。 首先,我们要...
《数据库系统概念》第六版是数据库领域的一本经典教材,主要涵盖了数据库设计、管理、查询以及相关理论。这里我们重点讨论其中与SQL相关的知识点,这些内容在提供的压缩包中可能包含幻灯片、附录、SQL模式和数据,...
《数据库系统概念》第六版是一本广泛使用的教材,深入浅出地介绍了数据库设计与管理的理论和实践。课后习题与实践题是学习过程中不可或缺的部分,它们帮助学生巩固理论知识,提升实际操作技能。以下是对这些知识点的...
通过研读《数据库系统概念》第六版及其官方答案,你将获得全面的数据库知识,这对于成为数据库管理员、开发人员或数据分析专业人士来说是不可或缺的。答案集提供了对教材问题的解答,可以帮助你检查理解程度,深化...
综上所述,这个英文版的《数据库系统概念》第六版答案集是学习数据库理论和实践的宝贵资源,无论你是数据库初学者还是希望提升专业技能的从业者,都可以从中受益匪浅。通过深入研读和实践,你可以全面了解并掌握...
《数据库系统概念》第六版是数据库领域的经典教材,它深入浅出地介绍了数据库的基本理论、设计与管理。这本书特别适合对Oracle 11g数据库高级管理员进行深入学习和提升。Oracle 11g是一款功能强大的关系型数据库管理...
《数据库系统概念》第六版是一本广泛使用的教材,深入浅出地介绍了数据库的基本原理和应用。这本教材的课后习题旨在帮助学生巩固理论知识,提高实践能力。通过对这些习题的解答,学生可以更深入地理解数据库的设计、...
这份"数据库系统概念第六版课后习题部分答案"的压缩包文件,显然为学习者提供了宝贵的参考资源,帮助他们理解和掌握教材中的理论知识并解决实际问题。 文件名为"5-8章答案"的部分,意味着包含了第五章到第八章的...
《数据库系统概念》第六版是一本广泛使用的教材,深入浅出地介绍了数据库的基本原理和应用。在本书的实践练习和习题部分,读者可以深入理解并巩固所学知识。本资源提供了第13至16章的习题解答,帮助学生检查自己的...
《数据库系统概念》第六版是一本广泛使用的教材,深入浅出地介绍了数据库领域的基础理论和实用技术。本压缩包提供了该书第5至8章的实践练习和习题答案,帮助学习者更好地理解和掌握教材中的概念。 第5章通常会涵盖...
根据提供的文件信息,本文将对《数据库系统概念》第六版的课后答案进行详细的知识点梳理与解析。《数据库系统概念》是计算机科学领域内一本经典的教材,它深入浅出地介绍了数据库系统的各个方面,包括基本概念、设计...