单选题Given the following table definitions: EMPLOYEE ID NAME DEPTID 01Smith 10 02Bossy 20 03 20 Peterson 04Goss 30 05Pape 40 06Avery 50 07O'Neal 60 08Carter 50 DEPARTMENT ID DEPTNAME 05 Hardware 10 Kitchen 20 Shoes 30 Toys 40 Electronics 50 Automotive and t

题目
单选题
Given the following table definitions: EMPLOYEE ID NAME DEPTID 01Smith 10 02Bossy 20 03 20 Peterson 04Goss 30 05Pape 40 06Avery 50 07O'Neal 60 08Carter 50 DEPARTMENT ID DEPTNAME 05 Hardware 10 Kitchen 20 Shoes 30 Toys 40 Electronics 50 Automotive and the following query: SELECT e.id, d.deptname FROM employee e, department d WHERE e.deptid = d.id AND e.id > 4 Which of the following queries will produce the same result set as the query above?()
A

SELECT e.id, d.deptname FROM employee e, department d WHERE e.id > 4

B

SELECT e.id, d.deptname FROM employee e INNER JOIN department d ON e.deptid = d.id WHERE e.id > 4

C

SELECT e.id, d.deptname FROM employee e FULL OUTER JOIN department d ON e.id = d.id WHERE e.id > 4

D

SELECT e.id, d.deptname FROM employee e LEFT OUTER JOIN department d ON e.deptid = d.id WHERE e.id > 4 UNION ALL SELECT e.id, d.deptname FROM employee e RIGHT OUTER JOIN department d ON e.deptid = d.id WHERE e.id > 4


相似考题
更多“单选题Given the following table definitions: EMPLOYEE ID NAME DEPTID 01Smith 10 02Bossy 20 03 20 Peterson 04Goss 30 05Pape 40 06Avery 50 07O'Neal 60 08Carter 50 DEPARTMENT ID DEPTNAME 05 Hardware 10 Kitchen 20 Shoes 30 Toys 40 Electronics 50 Automotive and t”相关问题
  • 第1题:

    序列( )可能是第一趟冒泡排序后的结果。

    A.40 10 20 30 70 50 60
    B.20 30 10 40 70 50 60
    C.30 10 40 20 70 60 50
    D.20 30 10 40 60 50 70

    答案:D
    解析:
    本题考查数据结构与算法基础知识。
    n个记录进行冒泡排序的方法是:首先将第一个记录的关键字和第二个记录的关键字进行比较,若为逆序,则交换两个记录的值,然后比较第二个记录和第三个记录的关键字,依此类推,直至第n-1个记录和第n个记录的关键字比较完为止。上述过程称作一趟冒泡排序,其结果是关键字最大的记录被交换到第n个位置。然后进行第二趟冒泡排序,对前n-1个记录进行同样的操作,其结果是关键字次大的记录被交换到第n-1个位置。当进行完第n-1趟时,所有记录有序排列。
    显然,第一趟冒泡排序后最大元素会交换至序列末端。

  • 第2题:

    Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2 (30) JOB_ID VARCHAR2 (20) SALARY NUMBER MGR_ID NUMBER References EMPLOYEE_ID COLUMN DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS table DEPARTMENTSColumn name Data type Remarks DEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30) MGR_ID NUMBER References MGR_ID column of the EMPLOYEES table Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, salary FROM employees e, departments d WHERE e. department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement? ()

    • A、SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);
    • B、SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;
    • C、SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;
    • D、SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);

    正确答案:C

  • 第3题:

    Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2 (30) JOB_ID VARCHAR2 (20) SALARY NUMBER MGR_ID NUMBER References EMPLOYEE_ID COLUMN DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS table DEPARTMENTSColumn name Data type Remarks DEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30) MGR_ID NUMBER References MGR_ID column of the EMPLOYEES table Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, salary FROM employees e, departments d WHERE e. department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement?()

    • A、SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);
    • B、SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;
    • C、SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;
    • D、SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);

    正确答案:C

  • 第4题:

    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

  • 第5题:

    Examine the data from the EMP table: EMP_ID DEPT_ID COMMISSION 1 10 500 2 20 1000 3 10 4 10 600 5 30 800 6 30 200 7 10 8 20 300 The COMMISSION column shows the monthly commission earned by the employee. Which three tasks would require subqueries or joins in order to perform in a single step? ()

    • A、Deleting the records of employees who do not earn commission.
    • B、Increasing the commission of employee 3 by the average commission earned in department 20.
    • C、Finding the number of employees who do NOT earn commission and are working for department 20.
    • D、Inserting into the table a new employee 10 who works for department 20 and earns a commission that is equal to the commission earned by employee 3.
    • E、Creating a table called COMMISSION that has the same structure and data as the columns EMP_ID and COMMISSIONS of the EMP table.
    • F、Decreasing the commission by 150 for the employees who are working in department 30 and earning a commission of more then 800.

    正确答案:B,D,E

  • 第6题:

    单选题
    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.


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

  • 第7题:

    单选题
    Examine the data in the EMPLOYEES table. 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 EK_DIR 8000 120 Revi 20 110 SA_DIR 6500 On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. The JOB_ID column is a NOT NULL column. Evaluate this DELETE statement: DELETE employee_id, salary, job_id FROM employees WHERE dept_id = 90; Why does the DELETE statement fail when you execute it?()
    A

    There is no row with dept_id 90 in the EMPLOYEES table.

    B

    You cannot delete the JOB_ID column because it is a NOT NULL column.

    C

    You cannot specify column names in the DELETE clause of the DELETE statement.

    D

    You cannot delete the EMPLOYEE_ID column because it is the primary key of the table.


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

  • 第8题:

    单选题
    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER NOT NULL EMP_NAME VARCHAR2(30) JOB_ID VARCHAR2(20) SAL NUMBER MGR_ID NUMBER DEPARTMENT_ID NUMBER You want to create a SQL script file that contains an INSERT statement. When the script is run, the INSERT statement should insert a row with the specified values into the EMPLOYEES table. The INSERT statement should pass values to the table columns as specified below: EMPLOYEE_ID: Next value from the sequence EMP_ID_SEQEMP_NAME and JOB_ID: As specified by the user during run time, through substitution variables SAL: 2000 MGR_ID: No value DEPARTMENT_ID: Supplied by the user during run time through substitution variable. The INSERT statement should fail if the user supplies a value other than 20 or 50. Which INSERT statement meets the above requirements?()
    A

    INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, &ename','&jobid', 2000, NULL, &did);

    B

    INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did IN (20,50));

    C

    INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50)) VALUES (emp_id_seq.NEXTVAL, &ename','&jobid', 2000, NULL, &did);

    D

    INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50) WITH CHECK OPTION) VALUES (emp_id_seq.NEXTVAL, &ename','&jobid', 2000, NULL, &did);

    E

    INSERT INTO (SELECT * FROM employees WHERE (department_id = 20 AND department_id = 50) WITH CHECK OPTION ) VALUES (emp_id_seq.NEXTVAL, &ename','&jobid', 2000, NULL, &did);


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

  • 第9题:

    单选题
    Given the following table definitions: EMPLOYEE ID NAME DEPTID 01Smith 10 02Bossy 20 03 20 Peterson 04Goss 30 05Pape 40 06Avery 50 07O'Neal 60 08Carter 50 DEPARTMENT ID DEPTNAME 05 Hardware 10 Kitchen 20 Shoes 30 Toys 40 Electronics 50 Automotive and the following query: SELECT e.id, d.deptname FROM employee e, department d WHERE e.deptid = d.id AND e.id > 4 Which of the following queries will produce the same result set as the query above?()
    A

    SELECT e.id, d.deptname FROM employee e, department d WHERE e.id > 4

    B

    SELECT e.id, d.deptname FROM employee e INNER JOIN department d ON e.deptid = d.id WHERE e.id > 4

    C

    SELECT e.id, d.deptname FROM employee e FULL OUTER JOIN department d ON e.id = d.id WHERE e.id > 4

    D

    SELECT e.id, d.deptname FROM employee e LEFT OUTER JOIN department d ON e.deptid = d.id WHERE e.id > 4 UNION ALL SELECT e.id, d.deptname FROM employee e RIGHT OUTER JOIN department d ON e.deptid = d.id WHERE e.id > 4


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

  • 第10题:

    单选题
    Evaluate this SQL statement: SELECT e.emp_name, d.dept_name FROM employees e JOIN departments d USING (department_id) WHERE d.department_id NOT IN (10,40) ORSER BY dept_name; The statement fails when executed. Which change fixes the error? ()
    A

    remove the ORDER BY clause

    B

    remove the table alias prefix from the WHERE clause

    C

    remove the table alias from the SELECT clause

    D

    prefix the column in the USING clause with the table alias

    E

    prefix the column in the ORDER BY clause with the table alias

    F

    replace the condition d.department_id NOT IN (10,40) in the WHERE clause with d.department_id <> 10 AND d.department_id <> 40


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

  • 第11题:

    单选题
    Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2 (30) JOB_ID VARCHAR2 (20) SALARY NUMBER MGR_ID NUMBER References EMPLOYEE_ID COLUMN DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS table DEPARTMENTSColumn name Data type Remarks DEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30) MGR_ID NUMBER References MGR_ID column of the EMPLOYEES table Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, salary FROM employees e, departments d WHERE e. department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement?()
    A

    SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);

    B

    SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;

    C

    SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;

    D

    SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);


    正确答案: 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题:

    Examine the data in the EMPLOYEES table. 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 EK_DIR 8000 120 Revi 20 110 SA_DIR 6500 On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. The JOB_ID column is a NOT NULL column. Evaluate this DELETE statement: DELETE employee_id, salary, job_id FROM employees WHERE dept_id = 90; Why does the DELETE statement fail when you execute it?()

    • A、There is no row with dept_id 90 in the EMPLOYEES table.
    • B、You cannot delete the JOB_ID column because it is a NOT NULL column.
    • C、You cannot specify column names in the DELETE clause of the DELETE statement.
    • D、You cannot delete the EMPLOYEE_ID column because it is the primary key of the table.

    正确答案:C

  • 第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题:

    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

  • 第16题:

    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER NOT NULL EMP_NAME VARCHAR2(30) JOB_ID VARCHAR2(20) SAL NUMBER MGR_ID NUMBER DEPARTMENT_ID NUMBER You want to create a SQL script file that contains an INSERT statement. When the script is run, the INSERT statement should insert a row with the specified values into the EMPLOYEES table. The INSERT statement should pass values to the table columns as specified below: EMPLOYEE_ID: Next value from the sequence EMP_ID_SEQ EMP_NAME and JOB_ID: As specified by the user during run time, throughsubstitution variables SAL: 2000 MGR_ID: No value DEPARTMENT_ID: Supplied by the user during run time through substitution variable. The INSERT statement should fail if the user supplies a value other than 20 or 50. Which INSERT statement meets the above requirements?()

    • A、INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
    • B、INSERT INTO employees VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did IN (20,50));
    • C、INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50)) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
    • D、INSERT INTO (SELECT * FROM employees WHERE department_id IN (20,50) WITH CHECK OPTION) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
    • E、INSERT INTO (SELECT * FROM employees WHERE (department_id = 20 AND department_id = 50) WITH CHECK OPTION ) VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);

    正确答案:D

  • 第17题:

    单选题
    Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2 (30) JOB_ID VARCHAR2 (20) SALARY NUMBER MGR_ID NUMBER References EMPLOYEE_ID COLUMN DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS table DEPARTMENTSColumn name Data type Remarks DEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30) MGR_ID NUMBER References MGR_ID column of the EMPLOYEES table Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, salary FROM employees e, departments d WHERE e. department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement? ()
    A

    SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);

    B

    SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;

    C

    SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;

    D

    SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);


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

  • 第18题:

    多选题
    Examine the data from the EMP table: EMP_ID DEPT_ID COMMISSION 1 10 500 2 20 1000 3 10 4 10 600 5 30 800 6 30 200 7 10 8 20 300 The COMMISSION column shows the monthly commission earned by the employee. Which three tasks would require subqueries or joins in order to perform in a single step? ()
    A

    Deleting the records of employees who do not earn commission.

    B

    Increasing the commission of employee 3 by the average commission earned in department 20.

    C

    Finding the number of employees who do NOT earn commission and are working for department 20.

    D

    Inserting into the table a new employee 10 who works for department 20 and earns a commission that is equal to the commission earned by employee 3.

    E

    Creating a table called COMMISSION that has the same structure and data as the columns EMP_ID and COMMISSIONS of the EMP table.

    F

    Decreasing the commission by 150 for the employees who are working in department 30 and earning a commission of more then 800.


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

  • 第19题:

    多选题
    Evaluate this SQL statement: SELECT e.emp_name, d.dept_name FROM employees e JOIN departments d USING (department_id) WHERE d.department_id NOT IN (10,40) ORSER BY dept_name; The statement fails when executed. Which change fixes the error?()
    A

    remove the ORDER BY clause

    B

    remove the table alias prefix from the WHERE clause

    C

    remove the table alias from the SELECT clause

    D

    prefix the column in the USING clause with the table alias

    E

    prefix the column in the ORDER BY clause with the table alias

    F

    replace the condition d.department_id NOT IN (10,40) in the WHERE clause with d.department_id <> 10 AND d.department_id <> 40


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

  • 第20题:

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

  • 第21题:

    单选题
    Examine the data in the EMPLOYEES and DEPARTMENTS tables. EMPLOYEES LAST_NAME DEPARTMENT_ID SALARY Getz 10 3000 Davis 20 1500 Bill 20 2200 Davis 30 5000 Kochhar 5000 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Sales 20 Marketing 30 Accounts 40 Administration You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?()
    A

    SELECT last_name, department_name FROM employees , departments(+);

    B

    SELECT last_name, department_name FROM employees JOIN departments(+);

    C

    SELECT last_name, department_name ON (e. department_ id = d. departments_id); FROM employees(+) e JOIN departments d

    D

    SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);

    E

    SELECT last_name, department_name FROM employees(+) , departments ON (e. department _ id = d. department _id);

    F

    SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e. department _ id = d. department _id);


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

  • 第22题:

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

  • 第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
    解析: 暂无解析