Which SQL statement produces an error?

Examine the structure of the EMP_DEPT_VU view:

Which SQL statement produces an error?

Examine the structure of the EMP_DEPT_VU view:

Which SQL statement produces an error?

A.
SELECT *
FROM emp_dept_vu;
Statement will not cause error
You get an error because of a primary key violation.

B.
SELECT department_id, SUM(salary)
FROM emp_dept_vu
GROUP BY department_id;
Statement will not cause error
The data and structure of the EMPLOYEES table are deleted.

C.
SELECT department_id, job_id, AVG(salary)
FROM emp_dept_vu
GROUP BY department_id, job_id;
Statement will not cause error
The data in the EMPLOYEES table is deleted but not the structure.

D.
SELECT job_id, SUM(salary)
FROM emp_dept_vu
WHERE department_id IN (10, 20)
GROUP BY job_id
HAVING SUM(salary) > 20000;
Statement will not cause error
QUESTION 216
You own a table called EMPLOYEES with this table structure:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATEWhat happens when you execute this DELETE statement?
DELETE employees;
You get an error because the statement is not syntactically correct.

E.
None of the statements produce an error; all are valid.

A.
SELECT *
FROM emp_dept_vu;
Statement will not cause error
You get an error because of a primary key violation.

B.
SELECT department_id, SUM(salary)
FROM emp_dept_vu
GROUP BY department_id;
Statement will not cause error
The data and structure of the EMPLOYEES table are deleted.

C.
SELECT department_id, job_id, AVG(salary)
FROM emp_dept_vu
GROUP BY department_id, job_id;
Statement will not cause error
The data in the EMPLOYEES table is deleted but not the structure.

D.
SELECT job_id, SUM(salary)
FROM emp_dept_vu
WHERE department_id IN (10, 20)
GROUP BY job_id
HAVING SUM(salary) > 20000;
Statement will not cause error
QUESTION 216
You own a table called EMPLOYEES with this table structure:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATEWhat happens when you execute this DELETE statement?
DELETE employees;
You get an error because the statement is not syntactically correct.

A.
SELECT *
FROM emp_dept_vu;
Statement will not cause error
You get an error because of a primary key violation.

B.
SELECT department_id, SUM(salary)
FROM emp_dept_vu
GROUP BY department_id;
Statement will not cause error
The data and structure of the EMPLOYEES table are deleted.

C.
SELECT department_id, job_id, AVG(salary)
FROM emp_dept_vu
GROUP BY department_id, job_id;
Statement will not cause error
The data in the EMPLOYEES table is deleted but not the structure.

D.
SELECT job_id, SUM(salary)
FROM emp_dept_vu
WHERE department_id IN (10, 20)
GROUP BY job_id
HAVING SUM(salary) > 20000;
Statement will not cause error
QUESTION 216
You own a table called EMPLOYEES with this table structure:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATEWhat happens when you execute this DELETE statement?
DELETE employees;
You get an error because the statement is not syntactically correct.

Explanation:
None of the statements produce an error.
Incorrect answer:

. You can remove existing rows from a table by using the DELETE statement.
DELETE [FROM] table
[WHERE. condition];
Incorrect answer:
A:
Statement will not cause error
B:
Delete statement will not delete the table structure
D:
Statement will not cause error
Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 8-19



Leave a Reply 1

Your email address will not be published. Required fields are marked *


AT

AT

Correct answer is E