w3resource
SQL exercises

SQL: Filter rows against NULL

SQL Wildcard & Special Operator : Exercise-20 with Solution

Write a SQL statement to find that customer with all information who does not get any grade except NULL.

Sample table: customer


Sample Solution :

SELECT *
FROM customer
WHERE grade IS NULL;

Output of the Query:

customer_id	cust_name	city	grade	salesman_id
3001		Brad Guzan	London		5005

Explanation :

Syntax of filter rows against NULL

Pictorial presentation :

Exercise: Filter rows against NULL

Query Visualization:

Duration:

Query visualization of Filter rows against NULL - Duration

Rows:

Query visualization of Filter rows against NULL - Rows

Cost:

Query visualization of Filter rows against NULL - Cost

 

Practice Online


Contribute your code and comments through Disqus.

Previous: Write a SQL statement to find those rows from the table testtable which does not contain the character ( % ) in its column 'col1'.
Next: Write a SQL statement to find that customer with all information who gets a grade except NULL value.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming