Información

Autor(es) Quentin Cappart
Fecha de entrega Sin fecha de envío
Tiempo límite de envío Sin límite de envío

Inicia sesión

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.


Pregunta 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';
Pregunta 2:
select course.title
from course, section
where course.course_id = section.course_id
     and section.year = 2024
     and section.semester = 'Fall';
Pregunta 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;
Pregunta 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';
Pregunta 5:
select classroom.building
from classroom, section
where classroom.building = section.building
      and classroom.room_number = section.room_number
      and section.course_id = '787';
Pregunta 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);
Pregunta 7:
select course.course_id
from course, prereq
where course.course_id = prereq.course_id
      and prereq.prereq_id = '608';
Pregunta 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;
Pregunta 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';
Pregunta 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;