Checking for NULL - Exercise

Contact Us or call 1-877-932-8228
Checking for NULL - Exercise

Checking for NULL

Duration: 5 to 15 minutes.

In this exercise, you will practice selecting records with fields that have NULL values.

  1. Create a report that shows the company name, contact name and fax number of all customers that have a fax number.
  2. Create a report that shows the first and last name of all employees who do not report to anybody.

Solution:

SimpleSelects/Solutions/Null.sql
SELECT CompanyName, ContactName, Fax
FROM Customers
WHERE Fax IS NOT NULL;

SELECT FirstName, LastName
FROM Employees
WHERE ReportsTo IS NULL;
Next