department(dept_name, building, budget)
course(course_id, title, dept_name, credits)
instructor(ID, name, dept_name, salary)
section(course_id, sec_id, semester, year, building, room_number, time_slot_id)
teaches(ID, course_id, sec_id, semester, year)
student(ID, name, dept_name, tot_cred)
takes(ID, course_id, sec_id, semester, year, grade)
查找超过 50 名学生参加的每门课程的课程名称、学期和年份
select course.title , takes.semester , takes.year from course natural join takes where course.course_id = takes.course_id having count(distinct ID) > 50
查找包含多个部分的每门课程的标题
select title from course natural join section where course.course_id = section.course_id having count(distinct sec_id) > 1
查找在 Comp 中教授超过 5 门课程的所有讲师的 ID。科学。部
select ID from instructor natural join course where course.dept_name = instructor. dept_name having count(credits)>5
这也应该是学分或 course_id
- 查找所有未教授生物系提供的任何模块的教师
这个我什至不知道从哪里开始