Quiz: Limit Rows Selected

1. 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;

 

2. Which of the following would be returned by this SELECT statement:
SELECT last_name, salary
FROM employees
WHERE salary <>

LAST_NAME SALARY
King 5000

LAST_NAME SALARY
Rajas 3500

LAST_NAME SALARY
Davies 3100(*)

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 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’;

 

5. 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’;

 

6. 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 (*)

 

7. How can you write not equal to in the WHERE-clause
!=
^=
<>
All of the above (*)

Solution for Test: Quiz: Introduction to The Oracle Academy
Solution for Test: Quiz: Data vs Information
Top