Examine the data in the EMPLOYEES and DEPARTMENTS tables: EM

题目
单选题
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
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Examine the data in the EMPLOYEES and EMP_HIST tables: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.

B.

C.

D.


参考答案:B

第2题:

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

B.

C.

D.

E.


参考答案:C

第3题:

Examine the data from the ORDERS and CUSTOMERS tables.Evaluate the SQL statement:What is the result when the query is executed?()

A.

B.

C.

D. The query fails because the subquery returns more than one row.

E. The query fails because the outer query and the inner query are using different tables.


参考答案:D

第4题:

Examine the structure of the EMPLOYEES and DEPARTMENTS tables:Evaluate this SQL statement:Which SQL statement is equivalent to the above SQL statement?()

A.

B.

C.

D.


参考答案:C

第5题:

Examine the structure of the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables.Which two SQL statements produce the name, department name, and the city of all the employees who earn more then 10000?()

A.

B.

C.

D.


参考答案:B, D

第6题:

Examine the structure of the EMPLOYEES, DEPARTMENTS, and TAX tables.EMPLOYEESNOT NULL, PrimaryEMPLOYEE_ID NUMBERKeyVARCHAR2EMP_NAME(30)VARCHAR2JOB_ID(20)SALARY NUMBERReferencesMGR_ID NUMBEREMPLOYEE_IDcolumnDEPARTMENT_ID NUMBER Foreign key toDEPARTMENT_IDcolumn ofthe DEPARTMENTStableDEPARTMENTSNOT NULL,DEPARTMENT_ID NUMBERPrimary KeyVARCHAR2DEPARTMENT_NAME|30|ReferencesMGR_ID columnMGR_ID NUMBERof theEMPLOYEES tableTAXMIN_SALARY NUMBERMAX_SALARY NUMBERTAX_PERCENT NUMBERFor 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.


参考答案:A

第7题:

Examine the structure if the EMPLOYEES and NEW EMPLOYEES tables:Which MERGE statement is valid?()

A.

B.

C.

D.


参考答案:A

第8题:

Examine the structure of the EMPLOYEES, DEPARTMENTS, and TAX tables.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.


参考答案:A

第9题:

Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables:Which UPDATE statement is valid?()

A.

B.

C.

D.


参考答案:A

第10题:

Examine the structure of the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables.EMPLOYEESNOT NULL,EMPLOYEE_ID NUMBERPrimary KeyVARCHAR2EMP_NAME(30)VARCHAR2JOB_ID(20)SALARY NUMBERReferencesMGR_ID NUMBEREMPLOYEE_IDcolumnDEPARTMENT_ID NUMBER Foreign key toDEPARTMENT_IDcolumn of theDEPARTMENTStableDEPARTMENTSNOT NULL, PrimaryDEPARTMENT_ID NUMBERKeyVARCHAR2DEPARTMENT_NAME(30)References NGR_IDMGR_ID NUMBERcolumn ofthe EMPLOYEES tableForeign key toLOCATION_ID NUMBERLOCATION_IDcolumn of theLOCATIONS tableLOCATIONSNOT NULL, PrimaryLOCATION_ID NUMBERKeyVARCHAR2CITY|30)Which two SQL statements produce the name, department name, and the city of all the employees who earn more then 10000?()

A. SELECT emp_name, department_name, city FROM employees e JOIN departments d USING (department_id) JOIN locations 1 USING (location_id) WHERE salary > 10000;

B. SELECT emp_name, department_name, city FROM employees e, departments d, locations 1 JOIN ON (e.department_id = d.department id) AND (d.location_id =1.location_id) AND salary > 10000;

C. SELECT emp_name, department_name, city FROM employees e, departments d, locations 1 WHERE salary > 10000;

D. SELECT emp_name, department_name, city FROM employees e, departments d, locations 1 WHERE e.department_id = d.department_id AND d.location_id = 1.location_id AND salary > 10000;

E. SELECT emp_name, department_name, city FROM employees e NATURAL JOIN departments, locations WHERE salary > 10000;


参考答案:A, D

更多相关问题