Oracle Introduction to Oracle9i: SQL (1Z0-007) Free Practice Test
Question 1
Examine the description of the EMPLOYEES table:
EMP_ID NUMBER(4) NOT NULL
LAST_NAME VARCHAR2(30) NOT NULL
FIRST_NAME VARCHAR2(30)
DEPT_ID NUMBER(2)
Which statement produces the number of different departments that have employees with last name Smith?
EMP_ID NUMBER(4) NOT NULL
LAST_NAME VARCHAR2(30) NOT NULL
FIRST_NAME VARCHAR2(30)
DEPT_ID NUMBER(2)
Which statement produces the number of different departments that have employees with last name Smith?
Correct Answer: B
Question 2
You need to perform these tasks:
1.Create and assign a MANAGER role to Blake and Clark
2.Grant CREATE TABLE and CREATE VIEW privileges to Blake and Clark
Which set of SQL statements achieves the desired results?
1.Create and assign a MANAGER role to Blake and Clark
2.Grant CREATE TABLE and CREATE VIEW privileges to Blake and Clark
Which set of SQL statements achieves the desired results?
Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
You need to modify the STUDENTS table to add a primary key on the STUDENT_ID column. The table is currently empty.
Which statement accomplishes this task?
Which statement accomplishes this task?
Correct Answer: E
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 4
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_id FROM employees WHERE dept_id = 90;
Why does the DELETE statement fail when you execute it?

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?
Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 5
Which three statements about subqueries are true? (Choose three.)
Correct Answer: A,C,E
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
Exhibit:

Examine the data in the EMPLOYEES table.
Examine the subquery:
SELECT last_name FROM employees WHERE salary IN (SELECT MAX(salary) FROM employees GROUP BY department_id);
Which statement is true?

Examine the data in the EMPLOYEES table.
Examine the subquery:
SELECT last_name FROM employees WHERE salary IN (SELECT MAX(salary) FROM employees GROUP BY department_id);
Which statement is true?
Correct Answer: D