Beginner

289. NVL Function

Learn how Oracle uses NVL to replace NULL values with an alternative value.

📘 Lesson 289 of 728 ⏱ 9 min 🎯 Intermediate

NVL is commonly used in Oracle Database to return an alternative value when the first expression is NULL.

Handling missing values is a common requirement in database reporting and analysis. NVL provides a simple Oracle-specific solution.

Display zero instead of NULL commission values.

SQL
SELECT
    EmployeeName,
    NVL(Commission, 0) AS Commission
FROM Employees;

NVL is widely used in Oracle reporting, financial calculations, data transformation, and analytical queries.

  • NVL handles NULL values.
  • It is commonly associated with Oracle.
  • It returns an alternative value for NULL.
  • It is useful in reporting.
  • COALESCE provides a more portable alternative.
What does NVL do?

NVL returns an alternative value when its first expression is NULL.

Which database commonly uses NVL?

NVL is commonly associated with Oracle Database.

Have you finished this lesson?

Introduction to SQL – All Lessons