fg

fg

Posts

Null Value

Description :
 Null is a value that is unavailable, unassigned, unknown, or inapplicable. Null is not the same as zero or a blank space. Zero is a number and blank space is a character. 

Examples:

SELECT last_name, job_id, salary, commission_pct

FROM   employees;

NULL

NULL VALUE

In the COMMISSION_PCT column in the EMPLOYEES table, notice that only a sales manager or sales representative can earn a commission. Other employees are not entitled to earn commissions. A NULL represents that fact.

SELECT last_name, 12*salary*commission_pct

FROM   employees;

arithmetic expression

NULL arithmetic expression

If any column value in an arithmetic expression is NULL, the result is NULL. For example, if you attempt to perform division by zero, you get an error. However, if you divide a number by NULL, the result is a NULL or unknown. 
In this select statement employee King does not get any commission. Because the COMMISSION_PCT column in the arithmetic expression is NULL.

No comments :

Post a Comment