以下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、更改emp

题目

以下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约束,要求每个雇员标识必须唯一

相似考题
参考答案和解析
正确答案:C
更多“以下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、更改emp”相关问题
  • 第1题:

    您在公司的数据库中成功创建了名为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)

    正确答案:A

  • 第2题:

    删除PRIMARYKEY约束条件及其所有依赖约束条件的语法是什么()

    • A、ALTER TABLE table_name DROP CONSTRAINT constraint_name CASCADE
    • B、ALTER TABLE table_name DROP CONSTRAINT FOREIGN KEY CASCADE
    • C、DROP CONSTRAINT table_name(constraint_name)
    • D、ALTER TABLE table_name DROP CONSTRAINT constraint_name

    正确答案:A

  • 第3题:

    Which SQL statement defines the FOREIGN KEY constraint on the DEPTNO column of the EMP table?()

    • A、CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) NOT NULL CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);
    • B、CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));
    • C、CREATE TABLE EMP (empno NUMBER(4) ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));
    • D、CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp deptno fk REFERENCES dept (deptno));

    正确答案:B

  • 第4题:

    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);

    正确答案:C

  • 第5题:

    You created a view called EMP_DEPT_VU that contains three columns from the EMPLOYEES and DEPARTMENTS tables: EMPLOYEE_ID, EMPLOYEE_NAME AND DEPARTMENT_NAME. The DEPARTMENT_ID column of the EMPLOYEES table is the foreign key to the primary key DEPARTMENT_ID column of the DEPARTMENTS table. You want to modify the view by adding a fourth column, MANAGER_ID of NUMBER data type from the EMPLOYEES tables. How can you accomplish this task? ()

    • A、ALTER VIEW EMP_dept_vu (ADD manger_id NUMBER);
    • B、MODIFY VIEW EMP_dept_vu (ADD manger_id NUMBER);
    • C、ALTER VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employee e, departments d WHERE e.department _ id = d.department_id;
    • D、MODIFY VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id = d.department_id;
    • E、CREATE OR REPLACE VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id = d.department_id;
    • F、You must remove the existing view first, and then run the CREATE VIEW command with a new column list to modify a view.

    正确答案:E

  • 第6题:

    单选题
    Which SQL statement defines the FOREIGN KEY constraint on the DEPTNO column of the EMP table?()
    A

    CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) NOT NULL CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);

    B

    CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));

    C

    CREATE TABLE EMP (empno NUMBER(4) ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));

    D

    CREATE TABLE EMP (empno NUMBER(4), ename VARCNAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp deptno fk REFERENCES dept (deptno));


    正确答案: A
    解析: 暂无解析

  • 第7题:

    单选题
    您在公司的数据库中成功创建了名为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)


    正确答案: B
    解析: 暂无解析

  • 第8题:

    单选题
    You created a view called EMP_DEPT_VU that contains three columns from the EMPLOYEES and DEPARTMENTS tables: EMPLOYEE_ID, EMPLOYEE_NAME AND DEPARTMENT_NAME. The DEPARTMENT_ID column of the EMPLOYEES table is the foreign key to the primary key DEPARTMENT_ID column of the DEPARTMENTS table. You want to modify the view by adding a fourth column, MANAGER_ID of NUMBER data type from the EMPLOYEES tables. How can you accomplish this task?()
    A

    ALTER VIEW EMP_dept_vu (ADD manger_id NUMBER);

    B

    MODIFY VIEW EMP_dept_vu (ADD manger_id NUMBER);

    C

    ALTER VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employee e, departments d WHERE e.department _ id = d.department_id;

    D

    MODIFY VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id = d.department_id;

    E

    CREATE OR REPLACE VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id = d.department_id;

    F

    You must remove the existing view first, and then run the CREATE VIEW command with a new column list to modify a view.


    正确答案: B
    解析: 暂无解析

  • 第9题:

    单选题
    The EMPLOYEES table is stored in the SAMPLE tablespace.  The corresponding IPK_EMP index for the EMPLOYEES table’s primary key is stored in the INDX tablespace.  Out of 12 partitions, only partition P1 of the SALES table is stored in the SAMPLE tablespace.  Which object will be exported by this command?()   exp system/manager tablespaces=SAMPLE
    A

    Only the EMPLOYEES table.

    B

    Only the EMPLOYEES table and its corresponding primary key index.

    C

    The EMPLOYEES table and partition P1.

    D

    The EMPLOYEES table, IPK_EMP index, and the SALES table.


    正确答案: A
    解析: 暂无解析

  • 第10题:

    多选题
    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2(30) JOB_ID NUMBER SAL NUMBER MGR_ID NUMBER References EMPLOYEE_ID column DEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table You created a sequence called EMP_ID_SEQ in order to populate sequential values for the EMPLOYEE_ID column of the EMPLOYEES table. Which two statements regarding the EMP_ID_SEQ sequence are true? ()
    A

    You cannot use the EMP_ID_SEQ sequence to populate the JOB_ID column.

    B

    The EMP_ID_SEQ sequence is invalidated when you modify the EMPLOYEE_ID column.

    C

    The EMP_ID_SEQ sequence is not affected by modifications to the EMPLOYEES table.

    D

    Any other column of NUMBER data type in your schema can use the EMP_ID_SEQ sequence.

    E

    The EMP_ID_SEQ sequence is dropped automatically when you drop the EMPLOYEES table.

    F

    The EMP_ID_SEQ sequence is dropped automatically when you drop the EMPLOYEE_ID column.


    正确答案: C,B
    解析: 暂无解析

  • 第11题:

    单选题
    要向雇员表中的部门标识列添加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(部门标识)


    正确答案: D
    解析: 暂无解析

  • 第12题:

    单选题
    Examine the structure if the EMPLOYEES table: Column name Data Type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2(30) JOB_ID VARCHAR2(20) NOT NULL SAL NUMBER MGR_ID NUMBER References EMPLOYEE_ID column DEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table You need to create a view called EMP_VU that allows the user to insert rows through the view. Which SQL statement, when used to create the EMP_VU view, allows the user to insert rows?()
    A

    CREATE VIEW emp_Vu AS SELECT employee_id, emp_name, department_id FROM employees WHERE mgr_id IN (102, 120);

    B

    CREATE VIEW emp_Vu AS SELECT employee_id, emp_name, job_id department_id FROM employees WHERE mgr_id IN (102, 120);

    C

    CREATE VIEW emp_Vu AS SELECT department_id, SUM(sal) TOTALSAL FROM employees WHERE mgr_id IN (102, 120) GROUP BY department_ id;

    D

    CREATE VIEW emp_Vu AS SELECT employee_id, emp_name, job_id, DISTINCT department_id FROM employees;


    正确答案: A
    解析: 暂无解析

  • 第13题:

    要向雇员表中的部门标识列添加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(部门标识)

    正确答案:B

  • 第14题:

    You created a view called EMP_DEPT_VU that contains three columns from the EMPLOYEES and DEPARTMENTS tables: EMPLOYEE_ID, EMPLOYEE_NAME AND DEPARTMENT_NAME. The DEPARTMENT_ID column of the EMPLOYEES table is the foreign key to the primary key DEPARTMENT_ID column of the DEPARTMENTS table. You want to modify the view by adding a fourth column, MANAGER_ID of NUMBER data type from the EMPLOYEES tables. How can you accomplish this task?()

    • A、ALTER VIEW EMP_dept_vu (ADD manger_id NUMBER);
    • B、MODIFY VIEW EMP_dept_vu (ADD manger_id NUMBER);
    • C、ALTER VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employee e, departments d WHERE e.department _ id = d.department_id;
    • D、MODIFY VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id = d.department_id;
    • E、CREATE OR REPLACE VIEW emp_dept_vu AS SELECT employee_id, employee_name, department_name, manager_id FROM employees e, departments d WHERE e.department _ id = d.department_id;
    • F、You must remove the existing view first, and then run the CREATE VIEW command with a new column list to modify a view.

    正确答案:E

  • 第15题:

    The EMPLOYEES table is stored in the SAMPLE tablespace.  The corresponding IPK_EMP index for the EMPLOYEES table’s primary key is stored in the INDX tablespace.  Out of 12 partitions, only partition P1 of the SALES table is stored in the SAMPLE tablespace.  Which object will be exported by this command?()   exp system/manager tablespaces=SAMPLE

    • A、Only the EMPLOYEES table.
    • B、Only the EMPLOYEES table and its corresponding primary key index.
    • C、The EMPLOYEES table and partition P1.
    • D、The EMPLOYEES table, IPK_EMP index, and the SALES table.

    正确答案:D

  • 第16题:

    Which SQL statement defines a FOREIGN KEY constraint on the DEPTNO column of the EMP table?()

    • A、CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);
    • B、CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));
    • C、CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));
    • D、CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));

    正确答案:B

  • 第17题:

    You created a view called EMP_DEPT_VU that contains three columns from the EMPLOYEES and DEPARTMENTS tables: EMPLOYEE_ID, EMPLOYEE_NAME AND DEPARTMENT_NAME. The DEPARTMENT_ID column of the EMPLOYEES table is the foreign key to the primary key DEPARTMENT_ID column of the DEPARTMENTS table. You want to modify the view by adding a fourth column, MANAGER_ID of NUMBER data type from the EMPLOYEES tables. How can you accomplish this task?()

    • A、ALTER VIEW emp_dept_vu (ADD manager_id NUMBER);
    • B、MODIFY VIEW emp_dept_vu (ADD manager_id NUMBER);
    • C、ALTER VIEW emp_dept_vu AS   SELECT employee_id, employee_name,   department_name, manager_id   FROM employee e, departments d   WHERE e.department_id = d.department_id;
    • D、MODIFY VIEW emp_dept_vu AS   SELECT employee_id, employee_name,   department_name, manager_id   FROM employees e, departments d   WHERE e.department_id = d.department_id;
    • E、CREATE OR REPLACE VIEW emp_dept_vu AS   SELECT employee_id, employee_name,   department_name, manager_id   FROM employees e, departments d   WHERE e.department_id = d.department_id;
    • F、You must remove the existing view first, and then run the CREATE VIEW command   with a new column list to modify a view.

    正确答案:E

  • 第18题:

    单选题
    You created a view called EMP_DEPT_VU that contains three columns from the EMPLOYEES and DEPARTMENTS tables: EMPLOYEE_ID, EMPLOYEE_NAME AND DEPARTMENT_NAME. The DEPARTMENT_ID column of the EMPLOYEES table is the foreign key to the primary key DEPARTMENT_ID column of the DEPARTMENTS table. You want to modify the view by adding a fourth column, MANAGER_ID of NUMBER data type from the EMPLOYEES tables. How can you accomplish this task?()
    A

    ALTER VIEW emp_dept_vu (ADD manager_id NUMBER);

    B

    MODIFY VIEW emp_dept_vu (ADD manager_id NUMBER);

    C

    ALTER VIEW emp_dept_vu AS   SELECT employee_id, employee_name,   department_name, manager_id   FROM employee e, departments d   WHERE e.department_id = d.department_id;

    D

    MODIFY VIEW emp_dept_vu AS   SELECT employee_id, employee_name,   department_name, manager_id   FROM employees e, departments d   WHERE e.department_id = d.department_id;

    E

    CREATE OR REPLACE VIEW emp_dept_vu AS   SELECT employee_id, employee_name,   department_name, manager_id   FROM employees e, departments d   WHERE e.department_id = d.department_id;

    F

    You must remove the existing view first, and then run the CREATE VIEW command   with a new column list to modify a view.


    正确答案: A
    解析: 暂无解析

  • 第19题:

    单选题
    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);


    正确答案: A
    解析: 暂无解析

  • 第20题:

    单选题
    评估以下语句: ALTER TABLE employees ADD CONSTRAINT employee_id PRIMARY KEY; 该语句将返回以下哪种结果()
    A

    将返回语法错误

    B

    将向EMPLOYEES表添加约束条件

    C

    将改写EMPLOYEES表的一个现有约束条件

    D

    将启用EMPLOYEES表的一个现有约束条件


    正确答案: A
    解析: 暂无解析

  • 第21题:

    单选题
    Which SQL statement defines a FOREIGN KEY constraint on the DEPTNO column of the EMP table?()
    A

    CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk FOREIGN KEY deptno REFERENCES dept deptno);

    B

    CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));

    C

    CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) NOT NULL, CONSTRAINT emp_deptno_fk REFERENCES dept (deptno) FOREIGN KEY (deptno));

    D

    CREATE TABLE EMP (empno NUMBER(4), ename VARCHAR2(35), deptno NUMBER(7,2) FOREIGN KEY CONSTRAINT emp_deptno_fk REFERENCES dept (deptno));


    正确答案: A
    解析: 暂无解析

  • 第22题:

    单选题
    以下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约束,要求每个雇员标识必须唯一


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    Examine the structure of the EMPLOYEES, DEPARTMENTS, and TAX tables. EMPLOYEES NOT NULL, Primary EMPLOYEE_ID NUMBER Key VARCHAR2 EMP_NAME (30) VARCHAR2 JOB_ID (20) SALARY NUMBER References MGR_ID NUMBER EMPLOYEE_ID column DEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table DEPARTMENTS NOT NULL, DEPARTMENT_ID NUMBER Primary Key VARCHAR2 DEPARTMENT_NAME |30| References MGR_ID column MGR_ID NUMBER of the EMPLOYEES table TAX MIN_SALARY NUMBER MAX_SALARY NUMBER TAX_PERCENT NUMBER For which situation would you use a nonequijoin query?()
    A

    To find the tax percentage for each of the employees.

    B

    To list the name, job id, and manager name for all the employees.

    C

    To find the name, salary, and department name of employees who are not working with Smith.

    D

    To find the number of employees working for the Administrative department and earning less then 4000.

    E

    To display name, salary, manager ID, and department name of all the employees, even if the employees do not have a department ID assigned.


    正确答案: C
    解析: 暂无解析