Used to add an attribute to one of the base relations. The new attribute with have NULLs in all existing tuples of the relation.
ALTER TABLE EMPLOYEE ADD JOB VARCHAR(12);Database users will need to update a value for the new job attribute for existing employees.
We may provide a default value:
ALTER TABLE EMPLOYEE ADD JOB VARCHAR(12) DEFAULT 'President';This is also a prerequisite for NOT NULL.
Depending on the order in which tables are created, circular referential integrity constraints may need to be added later, e.g.:
ALTER TABLE EMPLOYEE ADD FOREIGN KEY (DNO) REFERENCES DEPARTMENT (Dnumber);
ALTER TABLE DEPARTMENT ADD FOREIGN KEY (MGRSSN) REFERENCES EMPLOYEE (Ssn);