Information

Author(s) Quentin Cappart
Deadline No deadline
Submission limit No limitation

Sign in

Lecture de requêtes SQL (conditions plus complexes)

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.


Question 1:
select name
from student
where dept_name = 'Biology'
      and tot_cred between 30 and 90;
Question 2:
select course_id
from course
where dept_name = 'Physics'
      or credits = 4;
Question 3:
select name
from instructor
where salary > 50000
      and salary < 80000;
Question 4:
select dept_name
from department
where budget < 2000000
      or building = 'Watson';
Question 5:
select ID
from student
where dept_name = 'Biology'
      and (tot_cred < 30 or tot_cred > 100);
Question 6:
select title
from course
where credits between 2 and 4
      and dept_name = 'Comp. Sci.';
Question 7:
select building
from classroom
where capacity >= 50
      and capacity <= 150;
Question 8:
select time_slot_id
from time_slot
where day = 'M' --- Lundi (Monday)
    and start_hr >= 8
    and start_hr <= 12;
Question 9:
select name
from student
where (dept_name = 'Physics'
      or dept_name = 'Chemistry')
      and tot_cred > 60;
Question 10:
select name
from instructor
where (salary < 60000 or salary > 100000)
      and dept_name = 'Biology';