Using your “complete and verbose” dataset from yesterday, report on the following:
1. Create a summary of sales by employee.
Copy the results into a spreadsheet. Label the headings and include a total at the bottom.
The answer for #1 should look like this:
2. Create a summary of sales by product for the month of June 2013
Copy the results into a spreadsheet. Label the headings and include a total at the bottom.
The answer for #2 should look like this:
3. Create a summary of sales by customer for the month of August 2013 in the North Region
Your summary should have the following columns:
- Product Name
- Total Sales Amount (in dollars)
- Total Number of Transactions
- Average Transaction Amount
Copy the results into a spreadsheet and include a totals at the bottom for each of these three computed fields.
The answer for #3 should look like this:
How are we supposed to calculate sales within the mysql system? Are you expecting us to add a new column that represents the sum of each transcation sale (quantity * amount)? If so, where can we find that function/command?
LikeLike
I suppose you could do it that way. However, there is a field on the transaction table which represents the amount of the transaction. It should be called txn_amount.
LikeLike
Yes, I saw that and figured out that it represented the entire amount for that transaction. Now my question is how to group the employee names together and adding up all their transaction amounts. The SUM command returns a much smaller number (possibly the average) so I’m not sure where to go from here.
LikeLike
Take a look at the class notes.
LikeLike
This might help: http://www.w3schools.com/sql/sql_func_sum.asp
LikeLike
Some people seem to be having trouble with this.
Here are the first few lines of what the answer should look like.
Product Total Dollar Value of Transactions Transactions Avg Transaction Value
Ambrosia 1,992 7 284.58
Angel Delight 2,159 6 359.78
Apple 1,685 7 240.65
Apple Crings 1,323 14 94.50
Avocado 1,495 6 249.11
LikeLike
Jason, your answer summarises the table by product name but the question asks us to summarise by customer. This is confusing, some clarification?
LikeLike
Zaghie, I’ve added some pictures showing what the answers should look like. I hope this clarifies it.
LikeLike