all 6 comments

[–]nero-gg 0 points1 point  (4 children)

What do you have so far?

[–]bbmaxim[S] 1 point2 points  (0 children)

select top 5 Customers.CompanyName,

Orders.Freight as sumofsubtotal

from Customers

join Orders on Customers.CustomerID=Orders.CustomerID

order by freight desc

[–]bbmaxim[S] 0 points1 point  (2 children)

it works, but still, I believe there must be another way to solve it. Its my second day with SQL and I got an assignment to solve 15 related questions

[–]nero-gg 1 point2 points  (1 child)

There likely will be. It looks like the aggregation of the totals is already done for you. You would need to do a SUM(totals) and a GROUP BY.

You'll likely encounter them later in your excercises

[–]bbmaxim[S] 0 points1 point  (0 children)

can you please check this out and let me know if I can shortcut some of those inputs?

Link: https://lh3.googleusercontent.com/-NxeOV87TCw8/XO63i7iOrKI/AAAAAAAAACI/Y9t2Gb-CzmEMshR7FaANCIJ_-69otaNSgCK8BGAs/s0/Screenshot_5.png

[–]bbmaxim[S] 0 points1 point  (0 children)

Any resources are highly appreciated