Chapter 9 SQL Statements
397
♦ Drop the office column from the
employee
table.
ALTER TABLE employee
DELETE office
♦ The address column in the customer table can currently hold up to
35 characters. Allow it to hold up to 50 characters.
ALTER TABLE customer
MODIFY address CHAR(50)
♦ Add a column to the customer table assigning each customer a sales
contact.
ALTER TABLE customer
ADD sales_contact INTEGER
REFERENCES employee (emp_id)
ON UPDATE CASCADE
ON DELETE SET NULL
This foreign key is constructed with cascading updates and is set null on
deletes. If an employee has their employee ID changed, the column is
updated to reflect this change. If an employee leaves the company and
has their employee ID deleted, the column is set to NULL.