IS NULL in MYSQL by R4R Team

MYSQL IS NULL condition:
-Basically,The MySQL IS NULL condition is check the NULL value in a SELECT, INSERT, UPDATE and DELETE statement.

Syntax:
SELECT * FROM table_name
WHERE expression IS NULL;

Display all record of table employee:

SELECT * FROM employee;

emp_id emp_name department emp_salary
1 Aman 34000
2 Ram D2 43000
3 Ramesh D1 20000
4 John 65000
5 Sita D1 10000
6 Dinesh D2 15000


Now Display the employee record who have not any Department

SELECT * FROM employee WHERE department IS NULL;

emp_id emp_name department emp_salary
1 Aman 34000
4 John 65000



Leave a Comment: