← Quiz: Checking AI-Written SQL: all 10 questions
Quiz: Checking AI-Written SQL · Question 4 of 10
Why does WHERE branch != 'CSE' leave out a student whose branch is NULL?
Why does WHERE branch != 'CSE' leave out a student whose branch is NULL?
- A.NULL is treated as 'CSE'
- B.SQLite deletes NULL rows
- C.!= only works on numbers
- D.Comparing with NULL gives unknown, which WHERE treats as not true
Answer & explanation
Correct answer: Comparing with NULL gives unknown, which WHERE treats as not true
Handle NULLs explicitly, e.g. branch IS NULL OR branch != 'CSE'.
Can you get the rest right without peeking?
Take the timed Quiz: Checking AI-Written SQL quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →