SQL ALTER TABLE: Adding a Primary Key Constraint
The SQL statement ALTER TABLE customer ADD CONSTRAINT pk_id PRIMARY KEY (customer_id) will add a primary key constraint to the 'customer' table, specifically on the 'customer_id' column.
Explanation:
- ALTER TABLE: This command modifies the structure of an existing table.
- customer: This is the name of the table being modified.
- ADD CONSTRAINT pk_id: This adds a new constraint named 'pk_id' to the table.
- PRIMARY KEY (customer_id): This defines the 'customer_id' column as the primary key. A primary key ensures that each row in the table has a unique identifier, and it prevents duplicate values in the 'customer_id' column.
Therefore, the correct answer is A.
原文地址: https://www.cveoy.top/t/topic/nwRp 著作权归作者所有。请勿转载和采集!