Junior
From PDF
SQL
SQL & Databases
What is NULL in SQL and how is it handled?
NULL represents the absence of a value in a column. It is not the same as an empty string or
zero.
- Handling NULL:
- To check for NULL, use IS NULL or IS NOT NULL.
- To handle NULL in queries, use COALESCE() (returns the first non-NULL
value) or IFNULL().
Example:
SELECT Name, IFNULL(Salary, 0) FROM Employees;
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png