Course Content

Course Content

Null & Not Null Condition

Null and Not Null Condition in SQL In the same way that every other programming language has a conditional operator that returns True or False, there is a conditionals operator in SQL that returns Null or Not Null.


In SQL, the IS NOT NULL condition is used to check for non-NULL values. If a non-NULL value is detected, it returns TRUE; otherwise, it returns FALSE. In a SELECT, INSERT, UPDATE, or DELETE statement, it can be utilised.

The is null() method is used to determine whether a variable is null or not. If a variable has no value stored in it, it is deemed NULL. If the value of variable $var is NULL, it returns TRUE; otherwise, it returns FALSE.

The isset() function determines whether a variable is set, that is, whether it has been declared and is not NULL. If the variable exists and is not NULL, this method returns true; otherwise, it returns false.

In a SELECT statement, here's an example of how to use the MySQL IS NOT NULL condition: SELECT * FROM contacts WHERE last name IS NOT NULL; This MySQL IS NOT NULL example returns all records from the contacts table that do not have a null value for last name.

The is null() method determines whether or not a variable is NULL. If the variable is NULL, this method returns true (1); otherwise, it returns false/nothing.

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere