Question

Based on the tables below, which of the following ANSI SQL commands would return the average customer balance grouped by SalesRepNo?
GENERAL SALES DATABASE:
SALESREP
SalesRepNo RepName HireDate
654 Jones 01/02/2005
734 Smith 02/03/2007
345 Chen 01/25/2004
434 Johnson 11/23/2004

CUSTOMER
CustNo CustName Balance SalesRepNo
9870 Winston 500 345
8590 Gonzales 350 434
7840 Harris 800 654
4870 Miles 100 345

A) SELECT AVG (Balance)
FROM CUSTOMER
WHERE SalesRepNo;
B) SELECT AVG (Balance)
FROM CUSTOMER
GROUP BY SalesRepNo;
C) SELECT AVG (Balance)
FROM CUSTOMER, SALESREP
WHERE SALESREP.SalesRepNo = CUSTOMER.SalesRepNo;
D) SELECT AVG (Balance)
FROM CUSTOMER
ORDER BY SalesRepNo;

Answer

This answer is hidden. It contains 1 characters.