Creating Complex Conditions
The maximum number of columns that can be used to sort the results of a query is 52.
False
When two conditions are joined by the AND keyword, both conditions must be FALSE for a record to be included in the results.
False
The ____________________ clause is used to specify the order in which the data should be presented in the results of a query.
ORDER BY
To sort query output, use the ____________________ clause.
ORDER BY
The percent sign (%) is used in a search pattern to indicate "exactly one character in this position".
False
When performing a search on a(n) ____________________ column, the search condition does not need to be enclosed in single quotation marks.
numeric
When sorting the results in ascending order, which of the following values will be presented first in the output?
numeric
In regards to sorting, if a DISTINCT option is used in the SELECT clause of a query then ____.
only columns in the SELECT clause can be used for sorting
Based upon the contents of the BOOKS table in the accompanying figure, which of the following queries will retrieve all books published in 2001?
all of the above
The <>, !=, or ^= operators can be used to search for values that are not equivalent to the specified search condition.
True
The IN logical operator is similar to using OR.
True
The ____________________ symbol is used for determining whether or not a value is less than or equal to a specified search condition.
<=
Which of the following is not a valid comparison operator?
=>
If a numeric column is being used for comparison against the search condition, the search condition is enclosed in single quotation marks.
False
Which of the following search patterns could be used to find the word HELLO in Oracle11 g?
%H%
The "equal to" comparison operator is used to search for NULL values.
False
The < symbol is used to search for records containing a value that is less than or equal to the stated search condition.
False
The LIKE operator is used to indicate a range of values.
False
The SORT BY clause is used to present query results in a specific order.
False
The maximum number of columns that can be specified for sorting data is ____.
255
The ____________________ logical operator is used to combine search conditions that must both be TRUE to include a row in the results of a query.
AND
Which of the following operators can be used to combine search conditions?
AND
Which of the following search conditions can be used to identify records that do not have data stored in a column named ColB?
ColB IS NULL
To instruct Oracle11 g to sort data in descending order, enter ____ after the column name in the WHERE clause.
DESC
Comparison operators are used to combine search conditions.
False
A search condition can be specified in a(n) SELECT clause.
False
The ____________________ comparison operator is used to search for NULL values.
IS NULL
____________________ operators are used to combine search conditions in the WHERE clause of a query.
Logical
The ____________________ logical operator is used to reverse the meaning of a search condition.
NOT
Which of the following is NOT a comparison operator?
NOT
When sorting the results in descending order, which of the following values will be presented first in the output?
NULL
The ____________________ keywords can be included in an ORDER BY clause to indicate that NULL values should be listed last in the results.
NULLS LAST
The ____________________ logical operator is evaluated last in a sequence of logical operators.
OR
The ____________________ logical operator is used to combine search conditions when only one of the conditions must be TRUE to be included in the results.
OR
Which of the following queries will display all orders placed in the month of March?
SELECT * FROM orders WHERE orderdate LIKE '%Mar%';
Based upon the contents of the BOOKS table in the accompanying figure, which of the following queries will list all books stored in the BOOKS table with a retail price of more than $38 sorted by retail price?
SELECT * FROM books WHERE retail >38 ORDER BY retail;
Based upon the contents of the ORDERS table in the accompanying figure, which of the following queries will not list the orders that have been shipped to Atlanta or Seattle?
SELECT * FROM orders WHERE shipcity = 'Atlanta' OR shipcity = 'Seattle';
Based upon the contents of the ORDERS table in the accompanying figure, which of the following SQL statements will display all orders contained in the ORDERS table that have been shipped to the customer?
SELECT * FROM orders WHERE shipdate IS NOT NULL;
Based upon the contents of the ORDERS table in the accompanying figure, which of the following SQL statements will display how long it took to ship order # 1007 (based upon when the order was originally placed)?
SELECT order#, shipdate-orderdate FROM orders WHERE order# = 1007;
By default, query results are sorted in ascending order based upon the column specified in the ORDER BY clause.
True
Including the keywords NULLS FIRST in the ORDER BY clause will result in NULL values appearing first in the results, regardless of the specified sort sequence.
True
Logical operators are evaluated in the order of NOT, AND, and OR.
True
The following search condition would match the column value "Sunday": WHERE value LIKE 'Sun%'
True
The percent sign (%) and underscore (_) symbols can be used with the LIKE comparison operator to create a search pattern.
True
The underscore symbol (_) is used in a search pattern to indicate "exactly one character in this position".
True
Using the OR logical operator to combine search conditions based upon the same column is the same as using the IN comparison operator.
True
When sorting data, the values will be sorted in ascending order by default.
True
When two conditions are joined by the AND logical operator, both of the conditions must be evaluated as TRUE to be included in the query results.
True
A search condition begins with the keyword ____.
WHERE
By default, a column listed in an ORDER BY clause is displayed in ____________________ order.
ascending
A(n) ____ is used to indicate how data should relate to a given search condition.
comparison operator
When the WHERE clause contains multiple types of operators, which of the following is resolved last?
logical operators
The order in which NULL values appear in the results can be overridden by which of the following keywords?
none of the above
If there is an exact match between the data used for a primary sort, a(n) ____ can be used to determine the sequence used to display the data.
secondary sort
If a user performs a query that restricts the rows returned based upon a specified date, the date must be enclosed in ____.
single quotation marks (' ')