QuestionQ258

VerifiedCreating and Managing Tables

The EMPLOYEES table contains these columns:

  • LAST NAME. VARCHAR2(35)
  • SALARY. NUMBER(8, 2)
  • HIRE_DATE. DATE -

Management wants to add a default value to the SALARY column. You intend to alter the table using this SQL statement:

ALTER TABLE EMPLOYEES -  
MODIFY (SALARY DEFAULT 5000);  

What is true about this ALTER statement?

Explanation

Oracle permits adding or changing a DEFAULT value through ALTER TABLE ... MODIFY. The new default of 5000 applies only to later inserts where SALARY is omitted; it does not update existing rows whose SALARY value is NULL.

Community Discussion

No comments yet. Be the first to start the discussion!