早教吧 育儿知识 作业答案 考试题库 百科 知识分享

SQL.几道数据库题,1)createthecollegedatabaseandtables2)Setintegrityconstrainsandindexofalltheabovetables.3)Inputdataintothetables4)Solvethefollowingqueries(whichrefertothecollegedatabase)inSQL.(3)Findallpair

题目详情
SQL.几道数据库题,
1)create the college database and tables
2) Set integrity constrains and index of all the above tables.
3) Input data into the tables
4) Solve the following queries (which refer to the college database) in SQL.
(3) Find all pairs of student numbers such that both students studied with the same instructor.
(4) Find all triplets of instructors’ names of instructors who taught the same course.
(5) Find course numbers of courses taken by a student and taught by an instructor such that the student is advised by the instructor.
(6) Find all instructors who advise students who took a course from another instructor who is located in the same room.
(7) Find the names of instructors who taught every course taken by a student who lives in New Hampshire.
(8) Find all pairs of names of students and instructors such that the instructor advises the student but the student never took a course with the instructor.
(9) Find courses’ numbers such that two students are enrolled.
(10) Find courses’ numbers such that at least three students are enrolled.
(11) Find the names of instructors who taught every course taught by Prof.Evans.
(12) Find courses’ names of courses taught by every instructor who teaches cs240.
(13) Find students’ numbers,the lowest grade,the highest grade,and the average grade for students who took at least two courses,excluding cs110.
(14) Find instructors’ names for instructors who teach courses that enroll at least two students.
(15) List the names of instructors and the number of students advised by each instructor.
▼优质解答
答案和解析
楼主,你好!

根据你发问的问题和追问的评论,我觉得你应该先去把SQL的基本语法都掌握一下,然后根据实例去提高自己的数据库水平!

祝你早日成为DBA!