Multiple choice

Which ALTER TABLE statement should be used to add a PRIMARY KEY constraint on the MANUFACTURER_ID column of the PRODUCT table?

  1. ALTER TABLE product ADD PRIMARY KEY (manufacturer_id);

  2. ALTER TABLE product MODIFY CONSTRAINT PRIMARY KEY manufacturer_id;

  3. ALTER TABLE product MODIFY manufacturer_id CONSTRAINT PRIMARY KEY;

  4. ALTER TABLE product ADD CONSTRAINT manufacturer_id PRIMARY KEY;

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The correct syntax is ALTER TABLE table_name ADD PRIMARY KEY (column_name). Option A uses proper syntax with ADD PRIMARY KEY and the column in parentheses. Other options incorrectly use MODIFY or wrong keyword order.