DBA Quiz 13
Group functions can be nested to a depth of ____.
2
If the DISTINCT keyword is not included in the AVG function, the ____ keyword will be assumed.
ALL
The ____ function calculates the average of the numeric values in a specified column.
AVG
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
Line 5
Based upon the contents of the BOOKS table, which of the following will determine the number of books provided by publisher 3?
SELECT COUNT(pubid) FROM books WHERE pubid = 3;
Based on the contents of the BOOKS table, which of the following will display the date of the book with the earliest publication date?
SELECT MIN(pubdate) FROM books;
If a group function is used in the WHERE clause, then any individual columns listed in the SELECT clause must also be listed in the GROUP BY clause.
FALSE
The ____ clause is used to restrict the groups returned by a query.
HAVING
The VARIANCE function can be used with ____ columns.
NUMERIC
The AVG function can be used with ____ values.
Numeric
Based on the contents of the BOOKS table, which of the following is a valid SQL statement?
SELECT pubid, AVG(retail-cost) "Average Profit" FROM books GROUP BY pubid;
The ____ function calculates the standard deviation for a specific set of data.
STDDEV
AVG, COUNT, and STDDEV are all considered group functions.
TRUE
Group functions can only be nested to a depth of two
TRUE
The HAVING clause is used to restrict the groups returned by a query.
TRUE
The HAVING clause specifies which groups will be displayed in the results, while the WHERE clause restricts the records that are retrieved from the table for processing. _________________________
TRUE
The MAX function can be used with character data.
TRUE
The WHERE clause filters the data before grouping, while the HAVING clause filters the groups after grouping is performed. _________________________
TRUE
When group functions are nested, the inner function is always resolved first. _________________________
TRUE
Which of the following indicates the processing order for the indicated clauses?
WHERE, GROUP BY, HAVING