假设需要为表 customer 添加主键约束,主键列为 customer_id,可以使用如下( )方式。
A: Alter table CUSTOMER ADD pk_customer primary key (customer_id);
B: Altertable CUSTOMER ADD constraint pk_customer primary key (customer_id);
C: Alter table CUSTOMER ADD constraint pk_customer (customer_id);
D: Alter table CUSTOMER ADD primary key (customer_id);
A: Alter table CUSTOMER ADD pk_customer primary key (customer_id);
B: Altertable CUSTOMER ADD constraint pk_customer primary key (customer_id);
C: Alter table CUSTOMER ADD constraint pk_customer (customer_id);
D: Alter table CUSTOMER ADD primary key (customer_id);
举一反三
- 为表TEST中ID列添加主键约束的语法是() A: ALTER TABLE TEST CHANGE( ID INT PRIMARY KEY) B: ALTER TABLE TEST ADD( ID INT PRIMARY KEY) C: ALTER TABLE TEST MODIFY( ID INT PRIMARY KEY) D: ALTER TABLE TEST ADD CONSTRAINT PK PRIMARY KEY (ID)
- 假设需要更改表名“CUSTOMER”为“CUSTOMER_CHANGE”,可以使用()语句。 A: AALTER TABLE CUSTOMER RENAME CUSTOMER_CHANGE B: BALTER TABLE CUSTOMER RENAME TO CUSTOMER_CHANGE C: CRENAME TABLE CUSTOMER TO CUSTOMER_CHANGE D: DRENAME TABLE CUSTOMER CUSTOMER_CHANGE
- 假设需要删除Customer表中的LogoutTime列,可以使用如下()方式。 A: AALTER TABLE CUSTOMER DROP column LOGOUTTIME B: BUPDATE TABLE DROP column LOGOUTTIME C: CALTER TABLE CUSTOMER DROP LOGOUTTIME D: DUPDATE TABLE DROP LOGOUTTIME
- 图书借阅系统中,用户想实现向数据表“借阅”中添加主键,该如何操作( ). A: alter table 借阅 add constraint pk_b primary key(学号) B: alter table 借阅 add constraint pk_b primary key(书号) C: alter table 借阅 add constraint pk_b primary key(学号,书号) D: alter table 借阅 add constraint pk_b unique(学号,书号)
- B2C是英文( )的缩写。 A: Business to Customer B: Business 2 Customer C: Customer to Customer D: Customer 2 Customer