Oracle Database Programming - Section 3
Oracle Database Programming - Section 3
(1) Points
Defaults to an ascending order (ASC)(*)
(1) Points
The table name, EMPLOYEES, which would then automatically sort by all columns in the table
All columns in the EMPLOYEES table(*)
last_name, first_name(*)
(1) Points
The database will display the rows in whatever order it finds it in the
database, so no particular order. (*)
The results will be sorted ascending by LAST_NAME and FIRST_NAME only.
(1) Points
The result will not be sorted.
Null email values will not be displayed in the result.
Null email values will be displayed last in the result. (*)
Null email values will be displayed first in the result.
Correct.
(1) Points
The OR and AND conditions have the same precedence and will be evaluated
from left to right
The OR condition will be evaluated before the AND condition.
The OR and AND conditions have the same precedence and will be evaluated
from right to left
The AND condition will be evaluated before the OR condition. (*)
Correct.
6. The conversion function TO_CHAR is a single row function. True or False?
Mark for Review
(1) Points
True (*)
False
Correct
This statement fails when executed. Which change will correct the problem?
(1) Points
Include a SORT clause.
Remove the table aliases in the WHERE clause.
Reorder the clauses in the query. (*)
Remove the table aliases in the ORDER BY clause.
Correct.
(1) Points
True
False (*)
Correct
(1) Points
True
False (*)
Correct
(1) Points
True (*)
False
Correct
11. Which symbol in the WHERE clause means "Not Equal To"? (Choose Two)
Mark for Review
(1) Points
<>(*)
=+
><
NOT IN (..)(*)
Incorrect. See Section 3 Lesson 1.
(1) Points
The order in which the columns are displayed
The order in which the expressions are sorted
The order in which the operators are returned
The order in which the expressions are evaluated and calculated (*)
All of the above
Correct
13. Which clause would you include in a SELECT statement to sort the rows
returned by the LAST_NAME column?
Mark for Review
(1) Points
HAVING
FROM
WHERE
ORDER BY (*)
Correct.
(1) Points
True (*)
False
Correct.
(1) Points
BOTH
NOT
OR (*)
AND
Correct.
You want to display all players' names with position 6900 or greater.
You want the players names to be displayed alphabetically by last name and
then by first name.
Which statement should you use to achieve the required results?
(1) Points
SELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name DESC, first_name;
SELECT last_name, first_name
FROM players
WHERE position_id <= 6900
ORDER BY last_name, first_name;
SELECT last_name, first_name
FROM players
WHERE position_id >= 6900
ORDER BY last_name, first_name; (*)
SELECT last_name, first_name
FROM players
WHERE position_id > 6900
ORDER BY last_name, first_name;
Correct.
You must display the player name, team id, and salary for players whose
salary is in the range from 25000 through 100000 and whose team id is in
the range of 1200 through 1500. The results must be sorted by team id from
lowest to highest and then further sorted by salary from highest to lowest.
Which statement should you use to display the desired result?
(1) Points
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary > 24999.99 AND salary < 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id ASC, salary DESC;
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 25000 AND 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary DESC; (*)
SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 24999.99 AND 100000.01
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id DESC, salary DESC;
SELECT last_name, first_name, team_id, salary
FROM players
WHERE (salary > 25000 OR salary < 100000)
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary;
Correct.
(1) Points
True
False (*)
Correct
(1) Points
True (*)
False
Correct
6. Which statement about the default sort order is true?
Mark for Review
(1) Points
The earliest date values are displayed first. (*)
The lowest numeric values are displayed last.
Null values are displayed first.
Character values are displayed in reverse alphabetical order.
Correct.
(1) Points
The order in which the columns are displayed
The order in which the expressions are sorted
The order in which the operators are returned
The order in which the expressions are evaluated and calculated (*)
All of the above
Correct
(1) Points
The ORDER BY clause can only contain columns that are included in the
SELECT list.
The ORDER BY clause should immediately precede the FROM clause in a
SELECT statement
You can use a column alias in the ORDER BY clause. (*)
The default sort order of the ORDER BY clause is descending.
Correct.
(1) Points
Arithmetic, NOT, Concatenation, Logical
Arithmetic, Concatenation, Comparison, OR (*)
Arithmetic, NOT, Logical, Comparison
NOT, AND, OR, Arithmetic
Correct.
10. Find the clause that will give the same results as:
SELECT *
FROM d_cds
WHERE cd_id NOT IN(90, 91, 92);
(1) Points
WHERE cd_id NOT LIKE (90, 91, 92);
WHERE cd_id != 90 or cd_id != 91 or cd_id!= 92;
WHERE cd_id != 90 and cd_id != 91 and cd_id != 92; (*)
WHERE cd_id <=90 and cd_id >=92;
Correct
11. Evaluate this SELECT statement:
SELECT employee_id, last_name, first_name, salary 'Yearly Salary'
FROM employees
WHERE salary IS NOT NULL
ORDER BY last_name, first_name;
Which clause contains an error?
Mark for Review
(1) Points
FROM employees
SELECT employee_id, last_name, first_name, salary 'Yearly Salary' (*)
WHERE salary IS NOT NULL
ORDER BY last_name, 3;
Correct.
(1) Points
The results are sorted numerically only.
The results are sorted numerically and then alphabetically.
The results are sorted alphabetically and then numerically. (*)
The results are sorted alphabetically only.
Correct.
13. Which SELECT statement should you use to limit the display of product
information to those products with a price of less than 50?
Mark for Review
(1) Points
SELECT product_id, product_name
FROM products
WHERE price < 50.00
GROUP BY price;
SELECT product_id, product_name
FROM products
GROUP BY price < 50;
SELECT product_id, product_name
FROM products
WHERE price <= 50;
SELECT product_id, product_name
FROM products
HAVING price < 50;
SELECT product_id, product_name
FROM products
WHERE price < 50; (*)
Correct.
(1) Points
IN (*)
AND
BETWEEN AND ...
LIKE
Correct.
(1) Points
250(*)
50
1
25(*)
10
Correct.