Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Important fields that will be needed ( to save space I used abbreviations that should NOT be used in actual programming ) : tblCustomer: CustomerNumber

Important fields that will be needed (to save space I used "abbreviations" that should NOT be used in actual programming):
tblCustomer:
CustomerNumber [I put it as
"CustNum" - JUST for this exam]
SalesRepNumber [I put it as "RepNum"
JUST for this exam]
tbISIsrep:
SalesRepNumber [I put it as "RepNum" - JUST for this exam]
CommissionRate [I put it as "ComRate"
-IST for this exam]
SQL-6. Display the average balance (name it AvgBal) for those states (so display state) whose average balance is higher than the average balance of all customers. Display also the average of the whole table under the header AllAvg.
\table[[SELECT AVG(Balance),AVG(Balance),AVG(Balance),AVG(Balance)],[\table[[AS,AvgBal,,State,],[ SELECT,AVG(Balance),]],\table[[AS AvgBal, State,],[(SELECT AVG(Balance)]],\table[[AS AvgBal, State, As,],[AVG(Balance) AS AllAvg,A]],\table[[AS AvgBal, State,],[AVG(Balance) AS AllAvg]]],[FROM tblCustomer) AS,FROM tblCustomer) AS,FROM tblCustomer,\table[[FROM tblCustomer],[GROUP BY State]]],[\table[[AllAvg],[FROM tblCustomer]],Allavg,GROUP BY Sta,HAVING AvgBal>],[GROUP BY State,\table[[FROM tblCustomer],[GROUP BY State]],\table[[AVG(Balance);],[AVI]],FROM tblCustomer);],[HAVING AVG(Balance),\table[[HAVING AVG(Balance)],[> AllAvg;]],,],[\table[[(SELECT AVG(Balance)],[FROM tblCustomer);]],,,]]
SQL-7. List those sales reps who started working for the company before their manager.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions

Question

Is short-selling good for the stock markets?

Answered: 1 week ago

Question

What are some of the possible scenes from our future?

Answered: 1 week ago