Oracle Test Part-01

1. Which type of join should be written to perform an outer join of tables A and B that returns all rows from B?
a. Any outer join
b. A left outer join
c. A cross join
d. A right outer join
e. An inner join 
Answer: d. 
2. How many join conditions should be there to avoid a Cartesian Join for joining three tables?
a. 1
b. 2
c. 3
d. None of the above
Answer: b. 2
3. Top N analysis requires ____________ and ____________.
a. The use of rowed & Only an inline view
b. a GROUP BY clause & Only an inline view
c. an ORDER BY clause & An inline view and an outer query
d. None of the above
Answer: c. 
4. Examine the code given below:
SELECT employee_id FROM employees WHERE commission_pct=.5 OR salary > 23000
Which of the following statement is correct with regard to this code?

a. It returns employees who have 50% of the salary greater than $23,000:
b. It returns employees who have 50% commission rate or salary greater than $23,000:
c. It returns employees who have 50% of salary less than $23,000:
d. None of the above
Answer: b. 
5. Which of the following tasks can be performed by using the TO_CHAR function?
a. Convert ’10’to 10
b. Convert 10 to ’10’
c. Convert ‘TEN’ to 10
d. Convert a date to a character expression
e. Convert a character expression to a date
Answer: b, d. 
6. Which of the following SELECT statements will get the result ‘elloworld’ from the string ‘HelloWorld’?
a. SELECT SUBSTR (‘HelloWorld’,1) FROM dual;
b. SELECT INITCAP(TRIM(‘HellowWorld’, 1,1) FROM dual;
c. SELECT LOWER (SUBSTR (‘HellowWorld’, 2,1) FROM dual;
d. SELECT LOWER (SUBSTR(‘HellowWorld’, 2,1) FROM dual;
e. SELECT LOWER (TRIM (‘H’ FROM ‘Hello World’)) FROM dual;
Answer: e. 
7. Where is the GROUP BY clause statement placed in a SELECT statement that includes a WHERE clause?
a. Immediately after the SELECT clause
b. Before the WHERE clause
c. After the ORDER BY clause
d. After the WHERE clause
Answer: d. 
8. Which operators can be used in an outer join condition?
a. =
b. OR
c. IN
d. AND
Answer: a, d. 
9. Which type of view is implemented as a subquery embedded in the FROM clause of a SELECT statement and is identified by an alias?
a. Simple
b. Inline
c. Complex
d. Nested
Answer: b. 
10. Evaluate the following SQL statement:
SELECT ROUND (TRUNC (MOD (1600, 10),-1), 2) FROM dual;
What will be displayed?

a. 0
b. 1
c. 0.00
d. An error statement
Answer: a. 0

Comments

comments

Leave a Comment

Time limit is exhausted. Please reload CAPTCHA.