Informasjon

Forfatter(e) Quentin Cappart
Frist Ingen frist
Innleveringsgrense Ingen begrensning

Logg inn

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.


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