Tab

Quiz1


Which of the following statements is the correct syntax for adding a new column called Gender into a table called dbo.Employees that already contains data?
 
A. ALTER TABLE dbo.Employees ADD COLUMN Gender CHAR(1) NOT NULL
B. ALTER TABLE dbo.Employees ADD COLUMN GENDER CHAR(1) NULL
C. ALTER TABLE dbo.Employees ADD Gender CHAR(1) NOT NULL
D. ALTER TABLE dbo.Employees ADD Gender CHAR(1) NULL

Your Answer : C
Explanation:
To add a column to an existing table, the ALTER TABLE command is used with the ADD option (without the word COLUMN). Since there's data on the table already and since no default value has been specified, the column should be created with the NULL option. Otherwise an error will be encountered.