ExamPlay Dark Logo
Đăng nhập

Computer Science for IGCSE & O level - Databases (Section 1 - No. 44)

In the provided example, what would be the correct SQL command to find records where SeatColour is 'Red' AND (White OR Silver)?
SELECT * FROM CAR WHERE SeatColour = 'Red' AND (White OR Silver);
SELECT * FROM CAR WHERE SeatColour = 'Red' AND (White = 'Y' OR Silver = 'Y');
SELECT * FROM CAR WHERE SeatColour = 'Red' OR White = 'Y' OR Silver = 'Y';
SELECT Code FROM CAR WHERE SeatColour = 'Red' AND ('White' OR 'Silver');

Giải thích

Option 1 does not work as 'OR' does not work like that in SQL. Option 2 correctly uses the 'AND' operator to combine the conditions.

Bình luận (0)

Đăng nhập để bình luận
Quảng cáo
BrainBehindX Inc Logo
©2026; Được cung cấp bởi BrainBehindX Inc