Home > Archive > Oracle certifications > August 2005 > Qn. from SQL?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Qn. from SQL?
jksaviyo

2005-08-03, 2:47 pm

Can you answer it please!

This is SQL question:
Many answer is A,B,D,E.
But I did not read in the book such INSERT, UPDATE doing by subquiry.
So my opinion is B, C, D.
Any one can correct it please?


In which four clauses can a subquery be used? (Choose four.)

A. in the INTO clause of an INSERT statement
B. in the FROM clause of a SELECT statement
C. in the GROUP BY clause of a SELECT statement
D. in the WHERE clause of a SELECT statement
E. in the SET clause of an UPDATE statement
F. in the VALUES clause of an INSERT statement

Ans:
jksaviyo

2005-08-06, 2:46 pm

Ok, no one answering for my questions. So I will try to answer again.
Probably the answer is ABDE.
The question meaning is - after which clause we can make a subquery?
We can use WHERE, HAVING, FROM, INSERT INTO, UPDATE SET clauses.
Ex:
SELECT ename from emp WHERE sal IN (select sal from emp where deptno = 10);
SELECT ename, e.maxsal, deptno FROM emp m, (select MAX(sal) maxsal from emp )e where sal = e.maxsal;
UPDATE emp SET ename = (select ename from employ where empno = 237) where empno = 203;
INSERT INTO deptdup (dnumber, dpname, city) SELECT deptno, dname, loc FROM dept;

Also we can use in CREATE TABLE table-name AS ( ), DELETE FROM table-name WHERE col-name IN ( ).
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2009 examnotes.net