...

Database Managment - MySql

Back to Course

Lesson Description


Lession - #1296 SQL Null Values


What is SQL NULL value? An null value in a relational data base is used when the value in a column is unknown or missing. An null is neither a vacant(empty>
string (for character or datetime data types>
nor a zero value (for numeric data types>
.

Syntax


#null 
	SELECT column_names
FROM table_name
WHERE column_name IS NULL;

#not null
SELECT column_names
FROM table_name
WHERE column_name IS NOT NULL;




Let's see an example



SELECT * FROM EMPLOYEE WHERE dept is null;

Output


Try it here



SELECT * FROM EMPLOYEE WHERE dept is not null;

Output


Try it here
mysql when null.