单选题The EMPLOYEE table contains the following information: EMPNO NAME WORKDEPT 101 SAM A11 102 JOHN C12 103 JANE -104 PAT Remote 105 ANNE -106 BOB A11 The MANAGER table contains the following information: MGRID NAME DEPTNO EMPCOUNT 1 WU B01 - 2 JONES A11 -

题目
单选题
The EMPLOYEE table contains the following information: EMPNO NAME WORKDEPT 101 SAM A11 102 JOHN C12 103 JANE -104 PAT Remote 105 ANNE -106 BOB A11 The MANAGER table contains the following information: MGRID NAME DEPTNO EMPCOUNT 1 WU B01 - 2 JONES A11 - 3 CHEN - - 4 SMITH - -5 THOMAS C12 - After this statement is executed: UPDATE manager m SET empcount = (SELECT COUNT(workdept) FROM employee e WHERE workdept=m.deptno) What is the result of the following query?() SELECT mgrid, empcount FROM MANAGER WHERE empcount IS NOT NULL ORDER BY mgrid
A

MGRID EMPCOUNT ----- -------- 1 0 2 2 5 1

B

MGRID EMPCOUNT ----- -------- 1 0 2 2 3 0 4 0 5 1

C

MGRID EMPCOUNT ----- -------- 1 3 2 3 3 3 4 3 5 3

D

MGRID EMPCOUNT ----- -------- 1 0 2 2 3 2 4 2 5 1


相似考题

2.Given the following requirements:Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values ‘C‘, ‘H‘ and ‘N‘, and permits inserts only when a corresponding value for the employee‘s department exists in the DEPARTMENT table.Which of the following CREATE statements will successfully create this table?()A.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN (‘C‘,‘H‘,‘N‘)), );B.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES (‘C‘,‘H‘,‘N‘) );C.CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN (‘C‘,‘H‘,‘N‘)), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );D.CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN (‘C‘,‘H‘,‘N‘)) );

参考答案和解析
正确答案: D
解析: 暂无解析
更多“单选题The EMPLOYEE table contains the following information: EMPNO NAME WORKDEPT 101 SAM A11 102 JOHN C12 103 JANE -104 PAT Remote 105 ANNE -106 BOB A11 The MANAGER table contains the following information: MGRID NAME DEPTNO EMPCOUNT 1 WU B01 - 2 JONES A11 -”相关问题
  • 第1题:

    Given the following function: CREATE FUNCTION emplist ( ) RETURNS TABLE ( id CHAR(6) , firstname VARCHAR(12) , lastname VARCHAR(15) ) LANGUAGE SQL BEGIN ATOMIC RETURN SELECT EMPNO, FIRSTNME, LASTNAME FROM EMPLOYEE WHERE WORKDEPT IN ('A00', 'B00'); END How can this function be used in an SQL statement?

    • A、SELECT TABLE(EMPLIST()) FROM EMPLOYEE
    • B、SELECT TABLE(EMPLIST()) AS t FROM EMPLOYEE
    • C、SELECT EMPLIST(id, firstname, lastname) FROM EMPLOYEE
    • D、SELECT id, firstname, lastname FROM TABLE(EMPLIST()) AS t

    正确答案:D

  • 第2题:

    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements inserts a row into the table? ()

    • A、INSERT INTO employees VALUES (NULL, 'JOHN','Smith');
    • B、INSERT INTO employees( first_name, last_name) VALUES ('JOHN','Smith');
    • C、INSERT INTO employees VALUES ('1000','JOHN','NULL');
    • D、INSERT INTO employees(first_name,last_name, employee_id) VALUES ('1000, 'john','Smith');
    • E、INSERT INTO employees (employee_id) VALUES (1000);
    • F、INSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, 'john',");

    正确答案:C,E,F

  • 第3题:

    Which three statements inserts a row into the table?()

    • A、INSERT INTO employees   VALUES ( NULL, ‘John’,‘Smith’);
    • B、INSERT INTO employees( first_name, last_name)   VALUES(‘John’,‘Smith’);
    • C、INSERT INTO employees   VALUES (‘1000’,‘John’,NULL);
    • D、INSERT INTO employees(first_name,last_name, employee_id)   VALUES ( 1000, ‘John’,‘Smith’);
    • E、INSERT INTO employees (employee_id)   VALUES (1000);
    • F、INSERT INTO employees (employee_id, first_name, last_name)   VALUES ( 1000, ‘John’,‘’);

    正确答案:C,E,F

  • 第4题:

    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

  • 第5题:

    Examine the data of the EMPLOYEES table. EMPLOYEES (EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID) EMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_ID 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 HR_MGR 5000 106 Bryan 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA_DIR 6500 Which statement lists the ID, name, and salary of the employee, and the ID and name of the employee's manager, for all the employees who have a manager and earn more than 4000?()

    • A、SELECT employee_id "Emp_id", emp_name "Employee", salary, employee_id "Mgr_id", emp_name "Manager" FROM employees WHERE salary > 4000;
    • B、SELECT e.employee_id "Emp_id", e.emp_name "Employee",
    • C、salary,
    • D、employee_id "Mgr_id", m.emp_name "Manager" FROM employees e, employees m WHERE e.mgr_id = m.mgr_id AND e.salary > 4000;

    正确答案:C

  • 第6题:

    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2 (25) LAST_NAME VARCHAR2 (25) HIRE_DATE DATE Which UPDATE statement is valid? ()

    • A、UPDATE employees SET first_name = 'John' SET last_name = 'Smith' WHERE employee_id = 180;
    • B、UPDATE employees SET first_name = 'John', SET last_name = 'Smoth' WHERE employee_id = 180;
    • C、UPDATE employee SET first_name = 'John' AND last_name = 'Smith' WHERE employee_id = 180;
    • D、UPDATE employee SET first_name = 'John', last_name = 'Smith' WHERE employee_id = 180;

    正确答案:D

  • 第7题:

    单选题
    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
    解析: 暂无解析

  • 第8题:

    单选题
    EMPLOYEES and DEPARTMENTS data: EMPLOYEES DEMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_I 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 IT_ADMIN 5000 106 Smith 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA_DIR 6500 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Admin 20 Education 30 IT 40 Human Resources On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID. On the DEPARTMENTS table DEPARTMENT_ID is the primary key. Evaluate this UPDATE statement. UPDATE employees SET mgr_id = (SELECT mgr_id FROM employees WHERE dept_id= (SELECT department_id FROM departments WHERE department_name = 'Administration')), Salary = (SELECT salary FROM employees WHERE emp_name = 'Smith') WHERE job_id = 'IT_ADMIN'; What happens when the statement is executed?()
    A

    The statement executes successfully, leaves the manager ID as the existing value, and changes the salary to 4000 for the employees with ID 103 and 105.

    B

    The statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105.

    C

    The statement executes successfully, changes the manager ID to NULL, and changes the salary to 3000 for the employees with ID 103 and 105.

    D

    The statement fails because there is more than one row matching the employee name Smith.

    E

    The statement fails because there is more than one row matching the IT_ADMIN job ID in the EMPLOYEES table.

    F

    The statement fails because there is no 'Administration' department in the DEPARTMENTS table.


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

  • 第9题:

    单选题
    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2 (25) LAST_NAME VARCHAR2 (25) HIRE_DATE DATE Which UPDATE statement is valid?()
    A

    UPDATE employees SET first_name = 'John' SET last_name = 'Smith' WHERE employee_id = 180;

    B

    UPDATE employees SET first_name = 'John', SET last_name = 'Smoth' WHERE employee_id = 180;

    C

    UPDATE employee SET first_name = 'John' AND last_name = 'Smith' WHERE employee_id = 180;

    D

    UPDATE employee SET first_name = 'John', last_name = 'Smith' WHERE employee_id = 180;


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

  • 第10题:

    单选题
    What type of constraint is used to ensure that each row inserted into the EMPLOYEE table with a value in the WORKDEPT column has a row with a corresponding value in the DEPTNO column of the DEPARTMENT table?()
    A

    A check constraint on the EMPLOYEE table

    B

    A unique constraint on the EMPLOYEE table WORKDEPT column

    C

    A foreign key reference from the DEPARTMENT tables DEPTNO column to the WORKDEPT column of the EMPLOYEE table

    D

    A foreign key reference from the EMPLOYEE tables WORKDEPT column to the DEPTNO column of the DEPARTMENT table


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

  • 第11题:

    单选题
    Examine the data of the EMPLOYEES table. EMPLOYEES (EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID) EMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_ID 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 HR_MGR 5000 106 Bryan 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA_DIR 6500 Which statement lists the ID, name, and salary of the employee, and the ID and name of the employee's manager, for all the employees who have a manager and earn more than 4000?()
    A

    SELECT employee_id Emp_id, emp_name Employee, salary, employee_id Mgr_id, emp_name Manager FROM employees WHERE salary > 4000;

    B

    SELECT e.employee_id Emp_id, e.emp_name Employee,

    C

    salary,

    D

    employee_id Mgr_id, m.emp_name Manager FROM employees e, employees m WHERE e.mgr_id = m.mgr_id AND e.salary > 4000;


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

  • 第12题:

    单选题
    Examine the data in the EMPLOYEES and EMP_HIST tables: EMPLOYEES NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_ID 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 IT_ADMIN 5000 106 Smith 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA_DIR 6500 EMP HIST EMPLOYEE_ID NAME JOB_ID SALARY 101 Smith SA_CLERK 2000 103 Chris IT_CLERK 2200 104 John HR_CLERK 2000 106 Smith AD_ASST 3000 108 Jennifer HR_MGR 4500 The EMP_HIST table is updated at the end of every year. The employee ID, name, job ID, and salary of each existing employee are modified with the latest data. New employee details are added to the table. Which statement accomplishes this task?()
    A

    UPDATE emp_hist SET employee_id, name, job_id, salary = (SELECT employee_id, name, job_id, salary FROM employees) WHERE employee_id IN (SELECT employee_id FROM employees);

    B

    MERGE INTO emp_hist eh USING employees e ON (eh.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE SET eh.name = e.name, eh.job_id = e.job_id, eh.salary = e.salary WHEN NOT MATCHED THEN INSERT VALUES (e.employee id, e.name, job id, e.salary);

    C

    MERGE INTO emp_hist eh USING employees e ON (eh.employee_id = e.employee_id) WHEN MATCHED THEN UPDATE emp hist SET eh.name = e.name, eh.job_id = e.job_id, eh.salary = e.salary WHEN NOT MATCHED THEN INSERT INTO emp_hist VALUES (e.employees_id, e.name, e.job_id, e.salary);

    D

    MERGE INTO emp_hist eh USING employees e WHEN MATCHED THEN UPDATE emp_hist SET eh.name = e.name, eh.job_id = e.job_id, eh.salary = e.salary WHEN NOT MATCHED THEN INSERT INTO emp_hist VALUES (e.employees_id, e.name, e.job_id, e.salary);


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

  • 第13题:

    Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()

    • A、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );
    • B、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );
    • C、CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );
    • D、CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );

    正确答案:D

  • 第14题:

    EMPLOYEES and DEPARTMENTS data: EMPLOYEES DEMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_I 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 IT_ADMIN 5000 106 Smith 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA_DIR 6500 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Admin 20 Education 30 IT 40 Human Resources On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID. On the DEPARTMENTS table DEPARTMENT_ID is the primary key. Evaluate this UPDATE statement. UPDATE employees SET mgr_id = (SELECT mgr_id FROM employees WHERE dept_id= (SELECT department_id FROM departments WHERE department_name = 'Administration')), Salary = (SELECT salary FROM employees WHERE emp_name = 'Smith') WHERE job_id = 'IT_ADMIN'; What happens when the statement is executed?()

    • A、The statement executes successfully, leaves the manager ID as the existing value, and changes the salary to 4000 for the employees with ID 103 and 105.
    • B、The statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105.
    • C、The statement executes successfully, changes the manager ID to NULL, and changes the salary to 3000 for the employees with ID 103 and 105.
    • D、The statement fails because there is more than one row matching the employee name Smith.
    • E、The statement fails because there is more than one row matching the IT_ADMIN job ID in the EMPLOYEES table.
    • F、The statement fails because there is no 'Administration' department in the DEPARTMENTS table.

    正确答案:D

  • 第15题:

    You discover that your Recycle Bin contains two tables with the same name, MY_TABLE. You also have a table named MY_TABLE in your schema. You execute the following statement: FLASHBACK TABLE my_table TO BEFORE DROP RENAME TO my_table2; What will be the result of executing this statement?()

    • A、One of the tables is recovered from the Recycle Bin using a First In First Out (FIFO) approach.
    • B、One of the tables is recovered from the Recycle Bin using a Last In First Out (LIFO) approach.
    • C、Both the tables are recovered from the Recycle Bin with one table renamed to MY_TABLE2 and the other to a system-generated name.
    • D、None of the tables are recovered from the Recycle Bin, and the statement returns an error.

    正确答案:B

  • 第16题:

    Examine the data in the EMPLOYEES and DEPARTMENTS tables: EMPLOYEES EMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_ID 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 IT_ADMIN 5000 106 Smith 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA*DIR 6500 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Admin 20 Education 30 IT 40 Human Resources Also examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables: CREATE TABLE departments (department_id NUMBER PRIMARY KEY, department _ name VARCHAR2(30)); CREATE TABLE employees (EMPLOYEE_ID NUMBER PRIMARY KEY, EMP_NAME VARCHAR2(20), DEPT_ID NUMBER REFERENCES departments(department_id), MGR_ID NUMBER REFERENCES employees(employee id), MGR_ID NUMBER REFERENCES employees(employee id), JOB_ID VARCHAR2(15). SALARY NUMBER); ON the EMPLOYEES, On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. DEPT_ID is foreign key to DEPARTMENT_ID column of the DEPARTMENTS table. On the DEPARTMENTS table, DEPARTMENT_ID is the primary key. Examine this DELETE statement: DELETE FROM departments WHERE department id = 40; What happens when you execute the DELETE statement?()

    • A、Only the row with department ID 40 is deleted in the DEPARTMENTS table.
    • B、The statement fails because there are child records in the EMPLOYEES table with department ID 40.
    • C、The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 110 and 106 are deleted from the EMPLOYEES table.
    • D、The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 106 and 110 and the employees working under employee 110 are deleted from the EMPLOYEES table.
    • E、The row with department ID 40 is deleted in the DEPARTMENTS table. Also all the rows in the EMPLOYEES table are deleted.
    • F、The statement fails because there are no columns specifies in the DELETE clause of the DELETE statement.

    正确答案:B

  • 第17题:

    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE Which UPDATE statement is valid?()

    • A、UPDATE employees SET first_name = 'John' SET last_name ='Smith' WHERE employee_id = 180;
    • B、UPDATE employees SET first_name = 'John', SET last_name ='Smith' WHERE employee_id = 180;
    • C、UPDATE employees SET first_name = 'John' AND last_name ='Smith' WHERE employee_id = 180;
    • D、UPDATE employees SET first_name = 'John', last_name ='Smith' WHERE employee_id = 180;

    正确答案:D

  • 第18题:

    The EMPLOYEE table contains the following information: EMPNO NAME WORKDEPT 101 SAM A11 102 JOHN C12 103 JANE -104 PAT Remote 105 ANNE -106 BOB A11 The MANAGER table contains the following information: MGRID NAME DEPTNO EMPCOUNT 1 WU B01 - 2 JONES A11 - 3 CHEN - - 4 SMITH - -5 THOMAS C12 - After this statement is executed: UPDATE manager m SET empcount = (SELECT COUNT(workdept) FROM employee e WHERE workdept=m.deptno) What is the result of the following query?() SELECT mgrid, empcount FROM MANAGER WHERE empcount IS NOT NULL ORDER BY mgrid

    • A、MGRID EMPCOUNT ----- -------- 1 0 2 2 5 1
    • B、MGRID EMPCOUNT ----- -------- 1 0 2 2 3 0 4 0 5 1
    • C、MGRID EMPCOUNT ----- -------- 1 3 2 3 3 3 4 3 5 3
    • D、MGRID EMPCOUNT ----- -------- 1 0 2 2 3 2 4 2 5 1

    正确答案:B

  • 第19题:

    单选题
    The EMPLOYEE table contains the following information: EMPNO NAME WORKDEPT 101 SAM A11 102 JOHN C12 103 JANE -104 PAT Remote 105 ANNE -106 BOB A11 The MANAGER table contains the following information: MGRID NAME DEPTNO EMPCOUNT 1 WU B01 - 2 JONES A11 - 3 CHEN - - 4 SMITH - -5 THOMAS C12 - After this statement is executed: UPDATE manager m SET empcount = (SELECT COUNT(workdept) FROM employee e WHERE workdept=m.deptno) What is the result of the following query?() SELECT mgrid, empcount FROM MANAGER WHERE empcount IS NOT NULL ORDER BY mgrid
    A

    MGRID EMPCOUNT ----- -------- 1 0 2 2 5 1

    B

    MGRID EMPCOUNT ----- -------- 1 0 2 2 3 0 4 0 5 1

    C

    MGRID EMPCOUNT ----- -------- 1 3 2 3 3 3 4 3 5 3

    D

    MGRID EMPCOUNT ----- -------- 1 0 2 2 3 2 4 2 5 1


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

  • 第20题:

    单选题
    Given the following function: CREATE FUNCTION emplist ( ) RETURNS TABLE ( id CHAR(6) , firstname VARCHAR(12) , lastname VARCHAR(15) ) LANGUAGE SQL BEGIN ATOMIC RETURN SELECT EMPNO, FIRSTNME, LASTNAME FROM EMPLOYEE WHERE WORKDEPT IN ('A00', 'B00'); END How can this function be used in an SQL statement?
    A

    SELECT TABLE(EMPLIST()) FROM EMPLOYEE

    B

    SELECT TABLE(EMPLIST()) AS t FROM EMPLOYEE

    C

    SELECT EMPLIST(id, firstname, lastname) FROM EMPLOYEE

    D

    SELECT id, firstname, lastname FROM TABLE(EMPLIST()) AS t


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

  • 第21题:

    单选题
    Given the following requirements: Create a table to contain employee data, with a unique numeric identifier automatically assigned when a row is added, has an EDLEVEL column that permits only the values 'C', 'H' and 'N', and permits inserts only when a corresponding value for the employee's department exists in the DEPARTMENT table. Which of the following CREATE statements will successfully create this table?()
    A

    CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED ALWAYS AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1), PRIMARY KEY emp_pk (empno), FOREIGN KEY emp_workdept_fk ON (workdept) REFERENCES department (deptno), CHECK edlevel_ck VALUES (edlevel IN ('C','H','N')), );

    B

    CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK edlevel VALUES ('C','H','N') );

    C

    CREATE TABLE emp ( empno SMALLINT NEXTVAL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3) NOT NULL, edlevel CHAR(1) CHECK IN ('C','H','N')), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY department (deptno) REFERENCES (workdept) );

    D

    CREATE TABLE emp ( empno SMALLINT NOT NULL GENERATED BY DEFAULT AS IDENTITY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, workdept CHAR(3), edlevel CHAR(1), CONSTRAINT emp_pk PRIMARY KEY (empno), CONSTRAINT emp_workdept_fk FOREIGN KEY (workdept) REFERENCES department (deptno), CONSTRAINT edlevel_ck CHECK (edlevel IN ('C','H','N')) );


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

  • 第22题:

    单选题
    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE Which UPDATE statement is valid?()
    A

    UPDATE employees SET first_name = 'John' SET last_name ='Smith' WHERE employee_id = 180;

    B

    UPDATE employees SET first_name = 'John', SET last_name ='Smith' WHERE employee_id = 180;

    C

    UPDATE employees SET first_name = 'John' AND last_name ='Smith' WHERE employee_id = 180;

    D

    UPDATE employees SET first_name = 'John', last_name ='Smith' WHERE employee_id = 180;


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

  • 第23题:

    单选题
    You discover that your Recycle Bin contains two tables with the same name, MY_TABLE. You also have a table named MY_TABLE in your schema. You execute the following statement: FLASHBACK TABLE my_table TO BEFORE DROP RENAME TO my_table2; What will be the result of executing this statement?()
    A

    One of the tables is recovered from the Recycle Bin using a First In First Out (FIFO) approach.

    B

    One of the tables is recovered from the Recycle Bin using a Last In First Out (LIFO) approach.

    C

    Both the tables are recovered from the Recycle Bin with one table renamed to MY_TABLE2 and the other to a system-generated name.

    D

    None of the tables are recovered from the Recycle Bin, and the statement returns an error.


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