Question: Q . Write a SQL query to select information from the Sales table. Sales table has following attributes: ( Sales _ No , Product _
QWrite a SQL query to select information from the Sales table. Sales table has following attributes:
SalesNo Productname, Branch, Sales amount,salespersonname, DOB
Calculate total sales amount in each branch.
Calculate the average sales amount in each branch.
Display all the salesmen, DOB who are born in the month of December as day in character format ie YYYYMMDD
Display the name and DOB of salesman in alphabetical order of the month
Instruction
Write a SQL query to calculate the total sales amount for each branch The query should;
Sum the sales amount from the sales table.
Group the results by branch id and branch to get the totalsales for each branch.
The output should include the branchid and branch and the corresponding totalsales
Write a SQL query to calculate the average sales amount for each branch. The query should:
Calculate the average of the salesamount from the sales table.
Group the results by branchid and Branch to get the averagesales for each branch.
The output should include the branchId and Branch and the corresponding averagesales Witte a SQL query to retrieve the name and dateofbirth of all salesmen born in December. The query should :
Select the name and date of birth columns from the salesmen table.
Filter the results to Include only those salesmen whose dateofbirth falls in the month of December.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
