JavaScript is required

Có bao nhiêu bản ghi mà câu lệnh SQL sau trả về?
Có bao nhiêu bản ghi mà câu lệnh SQL sau trả về? (ảnh 1)
SELECT * FROM KETQUA_KIEMTRA WHERE ID_SV <= 12 AND DIEM > 85;

A.
5
B.
4
C.
3
D.
2
Trả lời:

Đáp án đúng: C


The SQL statement returns records from the `KETQUA_KIEMTRA` table where `ID_SV` is less than or equal to 12 AND `DIEM` is greater than 85. Based on the data, student IDs 1, 2, 3, 7, 8, 10, and 12 meet the `ID_SV <= 12` criteria. Scores of 88, 90, 92, and 95 meet the `DIEM > 85` criteria. Combining these, records where the student ID is in the set {1, 2, 3, 7, 8, 10, 12} AND the score is greater than 85 are selected. This results in 3 records: (ID_SV=1, DIEM=88), (ID_SV=2, DIEM=90), and (ID_SV=8, DIEM=92).

Tổng hợp câu hỏi trắc nghiệm lập trình cơ sở dữ liệu SQL có đáp án đầy đủ nhằm giúp các bạn dễ dàng ôn tập lại toàn bộ các kiến thức.


50 câu hỏi 60 phút

Câu hỏi liên quan