Oracle Introduction to Oracle9i: SQL Sample Questions:
1. Examine the data from the EMP table. Evaluate this SQL statement:
SELECT * FROM emp WHERE commission = (SELECT commission FROM emp
WHERE emp_id=3);
What is the result when the query is executed?
A) The query fails because the outer query is retrieving more than one column
B) Exhibit A
C) The query returns no rows
D) Exhibit B
E) The query fails because both the inner and outer queries are retrieving data from the same table.
2. Which object privileges can be granted on a view?
A) DELETE, INSERT, SELECT, UPDATE
B) none
C) DELETE, INSERT,SELECT
D) ALTER, DELETE, INSERT, SELECT
3. Which three statements about subqueries are true? (Choose three.)
A) The subquery and main query must retrieve data from the same table.
B) The subquery and main query can retrieve data from different tables.
C) A subquery can have more than one main query.
D) Multiple columns or expression can be compared between the subquery and main query.
E) A main query can have more than one subquery.
F) Only one column or expression can be compared between the subquery and main query.
4. 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 DATE
What happens when you execute this DELETE statement?
DELETE employees;
A) The data and structure of the EMPLOYEES table are deleted.
B) You get an error because the statement is not syntactically correct.
C) You get an error because of a primary key violation.
D) The data in the EMPLOYEES table is deleted but not the structure.
5. Exhibit
Evaluate this SQL statement: SELECT cust_id, ord_total FROM orders WHERE ord_total > ANY (SELECT ord_total FROM orders WHERE cust_id IN (SELECT cust_id FROM customers WHERE city LIKE 'New York'));
What is the result when the above query is executed?
A) Option D
B) Option B
C) Option E
D) Option C
E) Option F
F) Option A
Solutions:
| Question # 1 Answer: C | Question # 2 Answer: A | Question # 3 Answer: B,E,F | Question # 4 Answer: D | Question # 5 Answer: F |

We're so confident of our products that we provide no hassle product exchange.


By Tobey


