
Explanation:
The correct command is ALTER TABLE orders DROP PRIMARY KEY CASCADE; because:
ALTER TABLE orders DROP PRIMARY KEY removes the PRIMARY KEY constraint from the orders table.CASCADE ensures that any dependent objects, like the FOREIGN KEY constraint in the users table referencing this PRIMARY KEY, are also dropped.Other options either lack the CASCADE keyword or contain syntax errors, making them incorrect.
Ultimate access to all questions.
No comments yet.
In a database, a column named id is the PRIMARY KEY for the orders table and also a FOREIGN KEY in the users table. Which command correctly removes the PRIMARY KEY constraint from the orders table and simultaneously drops the FOREIGN KEY reference?
A
ALTER orders DROP PRIMARY KEY CASCADE;
B
ALTER TABLE orders DROP PRIMARY_KEY;
C
ALTER TABLE orders DROP PRIMARY KEY CASCADE;
D
ALTER orders DROP PRIMARY_KEY;
E
ALTER TABLE orders DROP PRIMARY_KEY CASCADE;