单选题评估以下语句: ALTER TABLE employees ADD CONSTRAINT employee_id PRIMARY KEY; 该语句将返回以下哪种结果()A将返回语法错误B将向EMPLOYEES表添加约束条件C将改写EMPLOYEES表的一个现有约束条件D将启用EMPLOYEES表的一个现有约束条件
单选题
评估以下语句: ALTER TABLE employees ADD CONSTRAINT employee_id PRIMARY KEY; 该语句将返回以下哪种结果()
A
将返回语法错误
B
将向EMPLOYEES表添加约束条件
C
将改写EMPLOYEES表的一个现有约束条件
D
将启用EMPLOYEES表的一个现有约束条件
参考解析
解析:
暂无解析
相关考题:
在SQL Server 2000中,设有职工表(职工号, 职工名, 电子邮箱),现要限制电子邮箱的最后几位的取值为“@abc.com”,且“@”前至少有一位字符。下列添加约束的语句正确的是A.ALTER TABLE职工表 ADD CONSTRAINT chk_email CHECK(电子邮箱LIKE '_%@abc.com')B.ALTER TABLE职工表 ADD CONSTRAINT chk_email CHECK(电子邮箱 = '_%@abc.com')C.ALTER TABLE职工表 ADD CONSTRAINT chk_email CHECK(电子邮箱LIKE '_@abc.com')D.ALTER TABLE职工表 ADD CONSTRAINT chk_email CHECK(电子邮箱 = '_@abc.com')
以下语句错误的是( )A. alter table emp delete column addcolumn;B. alter table emp modify column addcolumn char(10);C.alter table emp change addcolumn addcolumn int;D. alter table emp add column addcolumn int;
为“部门”表增加一个“人数”字段,类型为整型,正确的语句是( )。A.ALTER TABLE部门ALTER人数IB.ALTER TABLE部门ALTER FIELDS人数IC.ALTER TABLE部门ADD人数ID.ALTER TABLE部门ADD FIELDS人数I
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty. Which statement accomplishes this task?() A. ALTER TABLE students ADD PRIMARY KEY _ id;B. ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);C. ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;D. ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);E. ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
Which statement adds a constraint that ensures the CUSTOMER_NAME column of the CUSTOMERS table holds a value?() A. ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;B. ALTER TABLE customers MODIFY CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;C. ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn NOT NULL;D. ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn IS NOT NULL;E. ALTER TABLE customers MODIFY name CONSTRAINT cust_name_nn NOT NULL;F. ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name NOT NULL;
Which statement explicitly names a constraint? () A. ALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students (student_id);B. ALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);C. ALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);D. ALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);E. ALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
Which syntax turns an existing constraint on? () A. ALTER TABLE table_name ENABLE constraint_name;B. ALTER TABLE table_name STATUS = ENABLE CONSTRAINT constraint _ name;C. ALTER TABLE table_name ENABLE CONSTRAINT constraint _ name;D. ALTER TABLE table_name TURN ON CONSTRAINT constraint _ name;
为“部门”表增加一个“人数”字段,类型为整型,正确的语句是( )。 A.ALTER TABLE部门ALTER人数1SX 为“部门”表增加一个“人数”字段,类型为整型,正确的语句是( )。A.ALTER TABLE部门ALTER人数1B.ALTER TABLE部门ALTER FIELDS人数lC.ALTER TABLE部门ADD人数lD.ALTER TABLE部门ADDFIELDS人数l
为表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)
评估以下语句: ALTER TABLE employees ADD CONSTRAINT employee_id PRIMARY KEY; 该语句将返回以下哪种结果()A、将返回语法错误B、将向EMPLOYEES表添加约束条件C、将改写EMPLOYEES表的一个现有约束条件D、将启用EMPLOYEES表的一个现有约束条件
您在公司的数据库中成功创建了名为SALARY的表。您现在要通过向引用EMPLOYEES表的匹配列的SALARY表添加FOREIGNKEY约束条件来建立EMPLOYEES表与SALARY表之间的父/子关系。尚未向SALARY表添加任何数据。应执行以下哪条语句()A、ALTER TABLE salary ADD CONSTRAINT fk_employee_id_01 FOREIGN KEY(employee_id)REFERENCES employees(employee_id)B、ALTER TABLE salary ADD CONSTRAINT fk_employee_id_ FOREIGN KEY BETWEEN salary(employee_id)AND employees(employee_id)C、ALTER TABLE salary FOREIGN KEY CONSTRAINT fk_employee_id_REFERENCES employees(employee_id)D、ALTER TABLE salary ADD CONSTRAINT fk_employee_id_FOREIGN KEY salary(employee_id)=employees(employee_id)
要向雇员表中的部门标识列添加FOREIGNKEY约束条件以引用部门表中的标识列,应该使用哪个语句()A、ALTER TABLE雇员MODIFY COLUMN dept_id_fk FOREIGN KEY(部门标识)REFERENCES部门(部门标识)B、ALTER TABLE雇员ADD CONSTRAINT dept_id_fk FOREIGNKEY(部门标识)REFERENCES部门(部门标识)C、ALTER TABLE雇员ADD FOREIGN KEY CONSTRAINT dept_id_fk ON(部门标识)REFERENCES部门(部门标识)D、ALTER TABLE雇员ADD FOREIGN KEY 部门(部门标识)REFERENCES(部门标识)
删除PRIMARYKEY约束条件及其所有依赖约束条件的语法是什么()A、ALTER TABLE table_name DROP CONSTRAINT constraint_name CASCADEB、ALTER TABLE table_name DROP CONSTRAINT FOREIGN KEY CASCADEC、DROP CONSTRAINT table_name(constraint_name)D、ALTER TABLE table_name DROP CONSTRAINT constraint_name
Which syntax turns an existing constraint on?()A、ALTER TABLE table_name ENABLE constraint_name;B、ALTER TABLE table_name STATUS = ENABLE CONSTRAINT constraint_name;C、ALTER TABLE table_name ENABLE CONSTRAINT constraint_name;D、ALTER TABLE table_name STATUS ENABLE CONSTRAINT constraint_name;E、ALTER TABLE table_name TURN ON CONSTRAINT constraint_name;
Which statement explicitly names a constraint? ()A、ALTER TABLE student_grades ADD FOREIGN KEY (student_id) REFERENCES students (student_id);B、ALTER TABLE student_grades ADD CONSTRAINT NAME = student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);C、ALTER TABLE student_grades ADD CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);D、ALTER TABLE student grades ADD NAMED CONSTRAINT student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);E、ALTER TABLE student grades ADD NAME student_id_fk FOREIGN KEY (student_id) REFERENCES students (student_id);
DEPARTMENT 表包含以下列: DEPT_ID NUMBER, Primary Key DEPT_ABBR VARCHAR2(4) DEPT_NAME VARCHAR2(30) MGR_ID NUMBER EMPLOYEE 表包含以下列: EMPLOYEE_ID NUMBER EMP_LNAME VARCHAR2(25) EMP_FNAME VARCHAR2(25) DEPT_ID NUMBER JOB_ID NUMBER MGR_ID NUMBER SALARY NUMBER(9,2) HIRE_DATE DATE 请评估以下语句: ALTER TABLE employee ADD CONSTRAINT REFERENTIAL (mgr_id) TO department(mgr_id); 是以下哪个说法()A、ALTER TABLE语句创建从EMPLOYEE表到DEPARTMENT表的引用约束条件B、ALTER TABLE语句创建从DEPARTMENT表到EMPLOYEE表的引用约束条件C、ADD CONSTRAINT子句存在语法错误,因此ALTER TABLE语句将会失败D、ALTER TABLE语句执行成功,但不重新创建引用约束条件
以下SQL命令执行什么操作() ALTER TABLE employees ADD CONSTRAINT emp_manager_fk FOREIGN KEY(manager_id) REFERENCES employees(employee_id).A、更改employees表并禁用emp_manager_fk约束条件B、向EMPLOYEES表添加FOREIGN KEY约束条件,要求经理必须已是雇员C、向EMPLOYEES表添加FOREIGN KEY约束条件,要求经理标识应匹配每个雇员标识D、更改employees表并添加FOREIGN KEY约束,要求每个雇员标识必须唯一
设有表T,现要在该表新增加一个列,列名为:c1,类型为int。下列能实现该功能的语句是()。A、ALTER TABLE T ADD COLUMN c1 intB、ALTER TABLE T ADD (c1 int)C、ALTER TABLE T ADD COLUMN c1D、ALTER TABLE T ADD c1
修改表结构,下面哪一语句是正确的()A、ALTER TABLE cw km ADD istagB、ALTER TABLE cw km (ADD istag char(1))C、ALTER TABLE cw km ADD istag char(1)D、ALTER cw km ADD istag char(1)
您需要从方案中的雇员表中删除EMP_FK_DEPT约束条件。应使用哪条语句()A、DROP CONSTRAINT EMP_FK_DEPT FROM雇员B、DELETE CONSTRAINT EMP_FK_DEPT FROM雇员C、ALTER TABLE雇员DROP CONSTRAINT EMP_FK_DEPTD、ALTER TABLE雇员REMOVE CONSTRAINT EMP_FK_DEPT
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()A、ALTER TABLE students ADD PRIMARY KEY student_id;B、ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student _ id);C、ALTER TABLE students ADD CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);D、ALTER TABLE students MODIFY CONSTRAINT stud _ id _pk PRIMARY KEY (student _ id);
Which syntax turns an existing constraint on? ()A、ALTER TABLE table_name ENABLE constraint_name;B、ALTER TABLE table_name STATUS = ENABLE CONSTRAINT constraint _ name;C、ALTER TABLE table_name ENABLE CONSTRAINT constraint _ name;D、ALTER TABLE table_name TURN ON CONSTRAINT constraint _ name;
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.Which statement accomplishes this task?()A、ALTER TABLE students ADD PRIMARY KEY student_id;B、ALTER TABLE students ADD CONSTRAINT PRIMARY KEY (student_id);C、ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY student_id;D、ALTER TABLE students ADD CONSTRAINT stud_id_pk PRIMARY KEY (student_id);E、ALTER TABLE students MODIFY CONSTRAINT stud_id_pk PRIMARY KEY (student_id);
CREATE TABLE test(t_idINT,t_nmae CHAR(10))后,增加t_sex字段,以下语句正确的是()。A、ALTER TABLE test ADD t_sex CHAR(2)B、ALTER TABLE test ADD t_sexC、ALTER TABLE test ALTER t_sex CHAR(2)D、ALTER TABLE test DROP(t_sex CHAR(2))
单选题您在公司的数据库中成功创建了名为SALARY的表。您现在要通过向引用EMPLOYEES表的匹配列的SALARY表添加FOREIGNKEY约束条件来建立EMPLOYEES表与SALARY表之间的父/子关系。尚未向SALARY表添加任何数据。应执行以下哪条语句()AALTER TABLE salary ADD CONSTRAINT fk_employee_id_01 FOREIGN KEY(employee_id)REFERENCES employees(employee_id)BALTER TABLE salary ADD CONSTRAINT fk_employee_id_ FOREIGN KEY BETWEEN salary(employee_id)AND employees(employee_id)CALTER TABLE salary FOREIGN KEY CONSTRAINT fk_employee_id_REFERENCES employees(employee_id)DALTER TABLE salary ADD CONSTRAINT fk_employee_id_FOREIGN KEY salary(employee_id)=employees(employee_id)
单选题DEPARTMENT 表包含以下列: DEPT_ID NUMBER, Primary Key DEPT_ABBR VARCHAR2(4) DEPT_NAME VARCHAR2(30) MGR_ID NUMBER EMPLOYEE 表包含以下列: EMPLOYEE_ID NUMBER EMP_LNAME VARCHAR2(25) EMP_FNAME VARCHAR2(25) DEPT_ID NUMBER JOB_ID NUMBER MGR_ID NUMBER SALARY NUMBER(9,2) HIRE_DATE DATE 请评估以下语句: ALTER TABLE employee ADD CONSTRAINT REFERENTIAL (mgr_id) TO department(mgr_id); 是以下哪个说法()AALTER TABLE语句创建从EMPLOYEE表到DEPARTMENT表的引用约束条件BALTER TABLE语句创建从DEPARTMENT表到EMPLOYEE表的引用约束条件CADD CONSTRAINT子句存在语法错误,因此ALTER TABLE语句将会失败DALTER TABLE语句执行成功,但不重新创建引用约束条件
单选题以下SQL命令执行什么操作() ALTER TABLE employees ADD CONSTRAINT emp_manager_fk FOREIGN KEY(manager_id) REFERENCES employees(employee_id).A更改employees表并禁用emp_manager_fk约束条件B向EMPLOYEES表添加FOREIGN KEY约束条件,要求经理必须已是雇员C向EMPLOYEES表添加FOREIGN KEY约束条件,要求经理标识应匹配每个雇员标识D更改employees表并添加FOREIGN KEY约束,要求每个雇员标识必须唯一