× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
5
o
5
4
m
4
b
4
x
4
a
4
l
4
t
4
S
4
m
3
s
3
New Topic  
darla darla
wrote...
Posts: 305
Rep: 0 0
5 years ago
The following database will be used in this question:

GENERAL SALES DATABASE:

SALESREP
SalesRepNoRepNameHireDate
654Jones01/02/2005
734Smith02/03/2007
345Chen01/25/2018
434Johnson11/23/2004

CUSTOMER
CustNoCustNameBalanceSalesRepNo
9870Winston500345
8590Gonzales350434
7840Harris800654
4870Miles100345

Explain the use of the GROUP BY keyword. Include an example based on the CUSTOMER table from the General Sales database.
Textbook 
Database Processing: Fundamentals, Design, and Implementation

Database Processing: Fundamentals, Design, and Implementation


Edition: 15th
Authors:
Read 167 times
2 Replies

Related Topics

Replies
wrote...
5 years ago
The GROUP BY keyword is used in conjunction with the built-in functions of SQL. The GROUP BY keyword is given a column that records are to be grouped on. Records in the result table are then collected into groups based on the value of the grouping column. The built-in function is then performed on the records of each group separately. For example,

SELECT AVG(Balance)
FROM CUSTOMER
GROUP BY SalesRepNo;

is a query that returns the average balance of all customers associated with a specific sales representative.
darla Author
wrote...
5 years ago
Smart ... Thanks!
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  984 People Browsing
Related Images
  
 125
  
 171
  
 58
Your Opinion
What's your favorite math subject?
Votes: 293