Question DB-SQL-0007
EasyHow do you check whether a column is NULL in SQL?
- A.
salary = NULL
- B.
salary IS NULL
- C.
Show answer and explanation
Answer: B
Comparisons with NULL using = give UNKNOWN, never TRUE, so you must use IS NULL or IS NOT NULL.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
SQL question
How do you check whether a column is NULL in SQL?
salary = NULL
salary IS NULL
Answer: B
Comparisons with NULL using = give UNKNOWN, never TRUE, so you must use IS NULL or IS NOT NULL.
salary EQUALS NULL
salary == NULL