Thông tin

Tác giả Quentin Cappart
Hạn chót Không có hạn chót
Giới hạn nộp bài Không có giới hạn

Đăng nhập

Lecture de requêtes SQL (plusieurs relations)

Traduisez le plus précisément possible les requêtes SQL suivantes. N'hésitez pas à exécuter ces requêtes dans SQLite pour vérifier votre compréhension.


Câu hỏi 1:
select student.name
from student, advisor, instructor
where student.ID = advisor.s_ID
      and advisor.i_ID = instructor.ID
      and instructor.dept_name = 'Biology';
Câu hỏi 2:
select course.title
from course, section
where course.course_id = section.course_id
     and section.year = 2024
     and section.semester = 'Fall';
Câu hỏi 3:
select instructor.name
from instructor, teaches, course
where instructor.ID = teaches.ID
      and teaches.course_id = course.course_id
      and course.dept_name = 'Physics'
      and instructor.salary > 80000;
Câu hỏi 4:
select student.name
from student, takes, course
where student.ID = takes.ID
      and takes.course_id = course.course_id
      and course.credits = 3
      and student.dept_name = 'Biology';
Câu hỏi 5:
select classroom.building
from classroom, section
where classroom.building = section.building
      and classroom.room_number = section.room_number
      and section.course_id = '787';
Câu hỏi 6:
select student.name
from student, advisor, instructor
where student.ID = advisor.s_ID
      and advisor.i_ID = instructor.ID
      and (instructor.salary > 90000 or student.tot_credit > 100);
Câu hỏi 7:
select course.course_id
from course, prereq
where course.course_id = prereq.course_id
      and prereq.prereq_id = '608';
Câu hỏi 8:
select time_slot.day, time_slot.start_hr, time_slot.start_min
from time_slot, section
where time_slot.time_slot_id = section.time_slot_id
      and section.semester = 'Spring'
      and section.year = 2024;
Câu hỏi 9:
select instructor.name
from instructor, teaches, section
where instructor.ID = teaches.ID
      and teaches.course_id = section.course_id
      and teaches.sec_id = section.sec_id
      and teaches.semester = section.semester
      and teaches.year = section.year
      and section.building = 'Watson';
Câu hỏi 10:
select student.name
from student, takes, teaches
where student.ID = takes.ID
      and takes.course_id = teaches.course_id
      and takes.sec_id = teaches.sec_id
      and takes.semester = teaches.semester
      and takes.year = teaches.year
      and teaches.ID = 22591;