INFO-I308 Oracle 12c Book: Chapter 11 Quiz- Group functions

¡Supera tus tareas y exámenes ahora con Quizwiz!

If the DISTINCT keyword is not included in the SUM function, the ____ keyword will be assumed.​

ALL

Which of the following is a correct statement?​

An asterisk can be used as the argument for the COUNT function to include NULL values in the results.

Based upon the contents of the BOOKS table, which of the following SQL statements will return the number of different publishers represented in the table?​

SELECT COUNT(DISTINCT pubid) FROM books;

Which of the following is a valid SQL statement?​

SELECT SUM(quantity*retail) 'Total Sales' FROM orders JOIN orderitems ON orders.orderID = orderitems.orderID JOIN books ON orderitems ON orderitems.ISBN = books.ISBN WHERE orderdate = '02-APR-03';

Which of the following is a valid statement?​

Column aliases cannot be used in a GROUP BY clause.

The ____ clause is used to restrict the groups returned by a query.​

HAVING

Which of the following can be used with date columns?​

MIN

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?

SELECT COUNT(*) FROM orders WHERE shipdate IS NULL;

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;

​Based upon the contents of the ORDERS table, which of the following will display how many orders were shipped to each state?

SELECT shipstate, COUNT(*) FROM orders GROUP BY shipstate;

Which of the following is not considered a group function?​

TRUNC

If a SELECT statement contains HAVING, GROUP BY, and WHERE clauses, the ____ clause will be processed first.

WHERE

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

The STDDEV function can be used with ____ columns.​

numeric

The SUM function can only be used with ____ data.​

numeric


Conjuntos de estudio relacionados

UNIT 3 Chapter 19 Inflammation and the Immune Response

View Set

NSCC HMGT-2670 Front Office Procedures Final Ch 9-15

View Set

Section 17: AWS Elastic Beanstalk

View Set

Intermediate Accounting 3313 (Elsie Ameen) Ch. 4

View Set

Research Methods II - Chapter 7 Quiz

View Set

Chapter 20: Respiratory Function

View Set