1. Learn
  2. /
  3. Courses
  4. /
  5. Hierarchical and Recursive Queries in SQL Server

Exercise

Changing a table structure

Another basic SQL operation is to add or delete a column from a table. This can be done using the ALTER TABLE syntax followed by the desired operation. The syntax for these operations is defined as follows.

To add a column named new to the Employee table:

ALTER TABLE Employee 
ADD new;

To delete a column named old from Employee:

ALTER TABLE Employee 
DROP COLUMN old

You have the task to add a new column Email and drop the column Birthday from the Person table.

Instructions

100 XP
  • Add the column Email to Person.
  • Delete the column Birthday from Person.