ExamPlay Dark Logo
Zalogować się

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');

Wyjaśnienie

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.

Uwagi (0)

Zaloguj się, aby skomentować
Reklama
BrainBehindX Inc Logo
©2026; Obsługiwane przez BrainBehindX Inc