Oracle Test Part-02


11. What kinds of commands can be entered at the command prompt in 9i SQL Plus?
  1. PL/SQL Blocks
  2. SQL*PLUS commands
  3. Security commands
  4. SQL commands
Answer: a, b, d.
12. What will happen if the emp table shown below is queried:
select enpno,DISTINCT ename,Salary from emp;
  1. EMPNO ,unique value of ENAME and then SALARY are displayed
  2. EMPNO ,unique value of the two columns, ENAME and salary are displayed
  3. DISTINCT is not a valid keyword in SQL
  4. No values will be displayed because the statement will return an error
Answer: d.
13. Examine the description of the STUDENTS table:
STD_ID
NUMBER (4)
COURSE_ID
VARCHAR2 (10)
START_DATE
DATE
END_DATE
DATE
What are the aggregate functions valid on the START_DATE columns?
  1. SUM(start_date)
  2. AVG(start_date)
  3. COUNT(start_date)
  4. AVG(start_date, end_date)
  5. MIN(start_date)
Answer: c, e.
14. Evaluate the following SQL statement:
SELECT e.employee_id, (.15* e.salary) + (.5 * e.commission_pct) + (s.sales_amount * (.35 * e.bonus)) AS CALC_VALUE FROM employees e, sales WHERE e.employee_id = s.emp_id;
What will happen if all the parentheses are removed from the calculation?
  1. The value displayed in the CALC_VALUE column will be lower
  2. The value displayed in the CALC_VALUE column will be higher
  3. There will be no difference in the value displayed in the CALC_VALUE column
  4. An error will be reported
Answer: c.
15. Which SQL statement is used to search for strings that contain ‘SA_’ in the JOB_ID column?
  1. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE ‘%SA\_%’ ESCAPE ‘\’;
  2. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE ‘%SA_’;
  3. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE ‘%SA_’ ESCAPE “\”;
  4. SELECT employee_id, last_name, job_id FROM employees WHERE job_id = ‘%SA_’;
Answer: a.
16. Which of the following statements are correct with regard to WHERE and HAVING clauses?
  1. A WHERE clause can be used to restrict both rows and groups
  2. A WHERE clause can be used to restrict rows only
  3. A HAVING clause can be used to restrict both rows and groups
  4. A HAVING clause can be used to restrict groups only
  5. A HAVING clause CANNOT be used in Subqueries
Answer: b, d.
17. Which of the following substitution variables should be used to reuse the variable value without prompting the user each time?
  1. &
  2. ACCEPT
  3. PROMPT
  4. &&
Answer: d. &&
18. Evaluate the following SQL statement:
SELECT item_id, order_id, product_id FROM item
Which WHERE clause should be included to test the QUANTITY column for null values?
  1. WHERE quantity = NULL;
  2. WHERE quantity != NULL;
  3. WHERE quantity <> NULL;
  4. WHERE quantity IS NULL;
Answer: d.
19. Which of the following statements about the evaluation of clauses in a SELECT statement are true?
  1. The Oracle Server will evaluate a HAVING clause before a WHERE clause
  2. The Oracle Server will evaluate a WHERE clause before a GROUP BY clause
  3. The Oracle Server will evaluate a GROUP BY clause before a HAVING clause
  4. The Oracle Server will evaluate an ORDER BY clause before a WHERE clause
  5. The Oracle Server will evaluate an ORDER BY clause before a HAVING clause
Answer: b, c.
20. Examine the following SQL statement:
SELECT bonus FROM salary
WHERE bonus BETWEEN 1 AND 250
OR (bonus IN(190, 500, 600)
AND bonus BETWEEN 250 AND 500);
Which value could the statement return?
  1. 100
  2. 260
  3. 400
  4. 600
Answer: a.

Comments

comments

Leave a Comment

Time limit is exhausted. Please reload CAPTCHA.