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 (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.


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