Which of the following statements removes a primary key constraint from an existing table whose name is BookStore?
-
A.
ALTER TABLE BookStore REMOVE PRIMARY KEY;
-
B.
DELETE PRIMARY KEY FROM BookStore;
-
C.
DROP PRIMARY KEY FROM BookStore;
-
D.
ALTER TABLE BookStore DROP PRIMARY KEY;
Correct Answer:
D. ALTER TABLE BookStore DROP PRIMARY KEY;
Explanation:
The correct command to delete a primary key constraint from an existing table named BookStore is ALTER TABLE BookStore DROP PRIMARY KEY;. In SQL, the ALTER TABLE statement is used to modify the structure of an existing table, while the DROP PRIMARY KEY clause specifically identifies and removes the primary key constraint without needing to specify the column name. Other options like REMOVE or DELETE are syntactically incorrect for this specific structural modification in standard SQL or MySQL.
Click below to open Discussion & Feedback
0 Issues
Please
login to comment or Report Issues.