Consider the following table called EMPLOYEES: ID FIRSTNAME

题目
单选题
Consider the following table called EMPLOYEES: ID FIRSTNAME LASTNAME JOB LEVEL CLERK 3 If the following SQL statement is executed, how many rows will be deleted? DELETE FROM employees WHERE 1 = 1()
A

0

B

1

C

3

D

6

参考答案和解析
正确答案: D
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

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

第2题:

Examine the data in the EMPLOYEES and DEPARTMENTS tables:Also examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables: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: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

第3题:

Examine the data in the EMPLOYEES table:Which three subqueries work? ()

A. SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department _ id);

B. SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);

C. SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);

D. SELECT department_id FROM employees WHERE SALARY > ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);

E. SELECT last_name FROM employees Where salary > ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);

F. SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));


参考答案:C, D, E

第4题:

Click the Exhibit button and examine the data in the EMPLOYEES table.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_idFROM employeesWHERE 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

第5题:

Consider the following table called EMPLOYEES: ID FIRSTNAME LASTNAME JOB LEVELCLERK 3If the following SQL statement is executed, how many rows will be deleted? DELETE FROM employees WHERE 1 = 1()

A.0

B.1

C.3

D.6


参考答案:D

第6题:

Examine the data from the EMP table:EMP_ID DEPT_ID COMMISSION1 10 5002 20 10003 104 10 6005 30 8006 30 2007 108 20 300The 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

第7题:

Click the Exhibit button and examine the data in the EMPLOYEES table.Which three subqueries work? ()

A.SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department_id);

B.SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);

C.SELECT distinct department_id FROM employees WHERE salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);

D.SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);

E.SELECT last_name FROM employees WHERE salary > ANY (SELECT MAX(salary) FROM employees GROUP BY department_id);

F.SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));


参考答案:C, D, E

第8题:

Examine the data in the EMPLOYEES table.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: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

第9题:

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

第10题:

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

更多相关问题