A data analyst is working with a customer database and needs to identify all records where the 'FaxNumber' has not been provided. The column containing fax numbers allows for NULL values to indicate that the information is missing. Which SQL query will correctly retrieve only the records where the 'FaxNumber' is unknown?
The correct way to test for a NULL value (the absence of a value) in SQL is by using the IS NULL operator. Comparing a column to NULL using the equals operator (= NULL) will not work as expected because NULL is not equal to anything, including itself. Comparing to an empty string ('') is incorrect because an empty string is a value (a string of zero length), whereas NULL represents the absence of any value. Using the ISNULL() function in the WHERE clause is also incorrect for filtering; ISNULL() is a function used to replace a NULL value with another value (e.g., in a SELECT list), and its use in a WHERE clause for filtering is not standard and will not achieve the desired outcome.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why can't we use 'FaxNumber = NULL' instead of 'FaxNumber IS NULL'?
Open an interactive chat with Bash
What is the difference between NULL and an empty string ('') in SQL?
Open an interactive chat with Bash
What is the purpose of the ISNULL() function in SQL, and why can't it be used in the WHERE clause like that?
Open an interactive chat with Bash
CompTIA Data+ DA0-002 (V2)
Data Concepts and Environments
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .