The VAR function is used to determine the variance contained within a set of data.
True/False
False
The COUNT(*) function is only used to count the number of records containing NULL values.
True
False
False
The COUNT function can be used to count NULL, as well as, non-NULL values.
True
False
True
The STDDEV function calculates the standard deviation for the data contained in a specified field. _________________________
True
False
t
Pattern matching features available in a SELECT are targeted to analyze patterns or trends of a specific column of data across many rows.
True
False
t
When group functions are nested, the inner function is always resolved first. _________________________
True
False
t
The STDVAR function is used to determine the standard deviation of numeric data.
True
False
F
The ORDER BY clause is used to group data. _________________________
True
False
F
When a SELECT statement includes WHERE, HAVING, and GROUP BY clauses, the GROUP BY clause is always evaluated first. _________________________
True
False
F
The WHERE clause filters the data before grouping, while the HAVING clause filters the groups after grouping is performed. _________________________
True
False
t
The COUNT(*) function can be used to count the number of rows containing NULL and non-NULL values. _________________________
True
False
t
The GROUP BY clause can only be used when a SELECT statement includes a group function.
True
False
f
The GROUP BY clause is used to group data.
True
False
t
The MAX functions returns the smallest value stored in the specified column. _________________________
True
False
f
The COUNT function can only be used for numeric columns.
True
False
f
The COUNT function can only be used for numeric columns.
True
False
f
The COUNT function can only be used for numeric columns.
True
False
f
The MIN function is used to determine the smallest value in a specified column.
True
False
t
The VARIANCE function is used to determine the variance in a group of numeric data.
True
False
t
The DISTINCT keyword cannot be used with the MAX function.
True
False
f
The MIN function can be used with the DISTINCT or ALL keywords. _________________________
True
False
t
Group functions return one result per group of rows processed.
True
False
t
If
both nonaggregated and aggregated columns are used in the SELECT
clause, the GROUP BY clause must contain the nonaggregated columns.
True
False
t
The MAX function can only be used with numeric or date columns.
True
False
f
Columns used to group data in the GROUP BY clause must also be listed in the SELECT clause.
True
False
f
The ____ function can be used to determine the number of rows meeting a specific condition.
A.
ADD
B.
SUM
C.
COUNT
D.
TOTAL
c
The AVG function can be used with ____ values.
A.
numeric
B.
character
C.
date
D.
all of the above
a
The ____ function returns the smallest value in a specified column.
A.
LOW
B.
LOWEST
C.
MIN
D.
MINIMUM
c
Based upon the contents of the ORDERS table, which of the following will display how many orders were shipped to each state?
A. SELECT shipstate,COUNT(*)
FROM orders;
B. SELECT shipstate,COUNT(customer#)
FROM orders;
C. SELECT shipstate,COUNT(*)
FROM orders
HAVING COUNT(*) >0
D. SELECT shipstate,COUNT(*)
FROM orders
GROUP BY shipstate;
D. SELECT shipstate,COUNT(*)
FROM orders
GROUP BY shipstate;
Functions that return one result per group of rows are called ____ functions.
A. group
B. multiple-row
C. aggregate
D. all of the above
D. all of the above
A group function can be nested inside a(n)____.
A. group function
B. single-row function
C. order function
D. both a and b
D. both a and b
The MIN function can be used with ____ columns.
A. numeric
B. character
C. date
D. all of the above
D. all of the above
Based upon the contents of the BOOKS tables, which of the following SQL statements will return the number of different publishers represented in the table?
A. SELECT COUNT(DISTINCT pubid)
FROM books;
B. SELECT DISTINCT COUNT(pubid)
FROM books;
C. SELECT DISTINCT (COUNT(pubid))
FROM books;
D. SELECT (DISTINCT COUNT(pubid))
FROM books;
A. SELECT COUNT(DISTINCT pubid)
FROM books;
Based on the contents of the BOOKS table, which of the following is a valid SQL statement?
A. SELECT pubid, AVERAGE(retail-cost) "Average Profit"
FROM books;
B. SELECT pubid, AVERAGE(retail-cost) "Average Profit"
FROM books
GROUP BY pubid;
C. SELECT pubid, AVG(retail-cost) "Average Profit"
FROM books
GROUP BY pubid;
D. SELECT pubid, AVG(retail-cost) "Average Profit"
FROM books
HAVING retail-cost > 25;
C. SELECT pubid, AVG(retail-cost) "Average Profit"
FROM books
GROUP BY pubid;
What clause offers many options to identify measures and patterns to analyze in a query?
A. ANALYZE
B. MATCH_RECOGNIZE
C. PATTERN_MATCH
D. MATCH_TREND
B. MATCH_RECOGNIZE
Which of the following is a valid statement?
A. The ORDER BY clause cannot be used in a SELECT statement containing a GROUP BY clause.
B. Data returned from a GROUP BY clause will automatically be sorted in descending order.
C. Column aliases cannot be used in a GROUP BY clause.
D. Columns referenced in the GROUP BY clause must also be contained in the SELECT clause.
C. Column aliases cannot be used in a GROUP BY clause.
The VARIANCE function can be used with ____ columns.
A.
alphanumeric
B.
numeric
C.
date
D.
none of the above
B.numeric
Which of the following can be used with date columns?
A.
MIN
B.
MAX
C.
COUNT
D.
all of the above
D.all of the above
If
a group function is used in the SELECT clause, any ____ listed in the
SELECT clause must also be listed in the GROUP BY clause.
A.
aggregate function
B.
single-row function
C.
individual column
D.
all of the above
C.individual column
Which of the following is a correct statement?
A.
An asterisk can be used as the argument for the COUNT function to include NULL values in the results.
B.
The NULL keyword can be included in the argument of the COUNT function to include NULL values in the results.
C.
The ALL keyword can be included in the argument of the COUNT function to include NULL values in the results.
D.
The INCLUDE NULLS keywords can be included in the argument for the COUNT function to include NULL values in the results.
A.An asterisk can be used as the argument for the COUNT function to include NULL values in the results.
If the DISTINCT keyword is not included in the STDDEV function, the ____ keyword will be assumed.
A.
UNIQUE
B.
ALL
C.
NONULLS
D.
none of the above
B.ALL
If the DISTINCT keyword is not included in the SUM function, the ____ keyword will be assumed.
A.
UNIQUE
B.
ALL
C.
RANDOM
D.
none of the above
B.ALL
Based
on the contents of the BOOKS table, which of the following SQL
statements will return the total profit generated by books provided by
publisher 4?
A.
SELECT TOTAL(retail-cost) FROM books
WHERE pubid = 4;
B.
SELECT TOTAL(retail-cost) FROM books
GROUP BY pubid;
C.
SELECT SUM(retail-cost) FROM books
WHERE pubid = 4;
D.
SELECT SUM(retail-cost) FROM books
GROUP BY pubid = 4;
C.SELECT SUM(retail-cost) FROM booksWHERE pubid = 4;
If a SELECT statement contains HAVING, GROUP BY, and WHERE clauses, the ____ clause will be processed last.
A.
HAVING
B.
GROUP BY
C.
WHERE
D.
SELECT
A.HAVING
Which of the following cannot be used with date columns?
A.
MIN
B.
MAX
C.
AVG
D.
all of the above
C.AVG
Based on
the contents of the ORDERS table, which of the following SQL statements
will display the number of orders that have not been shipped?
A.
SELECT order#, COUNT(shipdate)
FROM orders
WHERE shipdate IS NULL;
B.
SELECT order#, COUNT(shipdate)
FROM orders
WHERE shipdate IS NULL
GROUP BY order#;
C.
SELECT COUNT(shipdate)
FROM orders
WHERE shipdate IS NULL;
D.
SELECT COUNT(*)
FROM orders
WHERE shipdate IS NULL;
D.SELECT COUNT(*)FROM ordersWHERE shipdate IS NULL;
Which of the following lines of the SQL statement contains an error?
1 SELECT title, MAX(retail)
2 FROM books
3 WHERE retail > 30
4 AND pubid = 1
5 GROUP BY retail
A.
Line 2
B.
Line 3
C.
Line 4
D.
Line 5
D.Line 5
The ____ function is used to determine how widely data are spread out within a group.
A.
STDDEV
B.
STANDARDDEV
C.
VARIANCE
D.
VAR
C.VARIANCE
The ____ function can be used to include NULL values in a calculation.
A.
AVG
B.
SUM
C.
NULL
D.
NVL
D.NVL
Based on
the contents of the ORDERS table, which of the following SELECT
statements will determine the number of orders placed by each customer?
A.
SELECT COUNT(DISTINCT(customer#))
FROM orders;
B.
SELECT COUNT(*)
FROM orders;
C.
SELECT customer#, COUNT(customer#)
FROM orders
GROUP BY customer#;
D.
none of the above
C.SELECT customer#, COUNT(customer#)FROM ordersGROUP BY customer#;