January 26th, 2011

Section 16 – Limit Rows Selected

Oracle Quiz, by admin.

1. Which of the following statements will work?

SELECT first_name ||’ ‘||last_name NAME, department_id DEPARTMENT, salary*12 “ANNUAL SALARY”
FROM employees
WHERE name = ‘King’;
SELECT first_name ||’ ‘||last_name NAME, department_id DEPARTMENT, salary*12 “ANNUAL SALARY”
FROM employees
WHERE last_name = ‘King’;(*)
SELECT first_name ||’ ‘||last_name NAME, department_id DEPARTMENT, salary*12 ‘ANNUAL SALARY’
FROM employees
WHERE last_name = ‘King’;
SELECT first_name ||’ ‘||last_name NAME, department_id DEPARTMENT, salary*12 ‘ANNUAL SALARY’
FROM employees
WHERE name = ‘King’;

2. How can you write not equal to in the WHERE-clause

!=
^=
<>
All of the above (*)

3. To restrict the rows returned from an SQL Query, you should use the _____ clause:

SELECT
WHERE(*)
GROUP BY
CONDITION
All of the above

4. Which of the following are true? (Choose Two)

Character strings are enclosed in double quotation marks
Date values are enclosed in single quotation marks(*)
Character values are not case-sensitive
Date values are format-sensitive(*)

5. Which example would limit the number of rows returned?

SELECT title FROM d_songs WHEN type_code = 88;
SELECT title FROM d_songs WHERE type_code = = 88;
SELECT title FROM d_songs WHERE type_code = 88;(*)
SELECT title FROM d_songs WHEN type_code = = 88;

6. Which query would give the following result?

LAST_NAME FIRST_NAME DEPARTMENT_ID
King Steven 90

SELECT last_name, first_name, department_id
FROM employees C
WHERE last_name = ‘KING’;
SELECT last_name, first_name, department_id
FROM employees
WHERE last_name = ‘King’;(*)
SELECT last_name, first_name, department_id
FROM employees
WHERE last_name LIKE ‘k%’;
SELECT last_name, first_name, department_id
FROM employees
WHERE last_name LIKE ‘KING’;

7. Which of the following would be returned by this SELECT statement:

SELECT last_name, salary
FROM employees
WHERE salary < 3500; LAST_NAME SALARY King 5000 LAST_NAME SALARY Rajas 3500 LAST_NAME SALARY Davies 3100(*) All of the above 8. Which of the following is true? Character strings must be enclosed in double quotation marks Date values are enclosed in single quotation marks (*) Character values are not case-sensitive Date values are not format-sensitive

Back Top

Leave a Reply