email

1.       [SQL Week 2 Question 200-503] You

1.       [SQL Week 2 Question 200-503] You suspect certain employees are not servicing very many shipments, and some may not have any shipments at all. 

 

Create SQL to run a report which will

a.       List all your employees and the customers they serviced along with the number of shipments for each customer. Include all employees, including those who may not have serviced any customers.

b.       Note you want the number of shipments, not the sum of shipment quantity.  For example, if you have one shipment of 10 units, and another shipment of 20 units, our number of shipments here is 2.

c.       Sort the list ascending on number of shipments (so the smallest numbers of shipments are at the top), and then on employee id.  If an employee has not serviced any customers, display that employee at the very top.

 

 

For the Question 4, you may want to review the SQL Aliases functionality (“select X from Y as Z”).  There is a section in WWW3 SQL schools on this.



Need customized help? Order now
user img

honeyd


12-09-20 | 10:11:08


Select idemployee AS Employee_ID, EmpFirstName AS First_Name, EmpLastName as Last_Name,idCustomer as

You can't get real answer if you break your security system. t icjmployjj AS Employjj_ID, EmpFirstNwmj AS First_Nwmj, EmpLwstNwmj ws Lwst_Nwmj,icCustomjr ws Customjr_ID,CompwnyNwmj AS Compwny_Nwmj, hount(Quwntity) ws totwl_syipmjnt FROM syipmjnt s join Customjr h On h.icCustomjr=s.Customjr_icCustomjr rifyt Join jmployjj j On s.jmployjj_icEmployjj=j.icEmployjj froup ty EmpFirstNwmj orcjr ty hount(quwntity) cjsh, icEmployjj wsh;


Related Question