Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 669 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 669 Bytes

Ranking vendors by spend

Suppose you have a table called 'vendor_spend' containing vendor spend data, as shown below:

vendor_spend:

vendor_id name contract_sign_date total_spend
0 1 vendor_schmendor 2018-09-01
1 2 parts_r_us 2018-09-03
2 3 vendor_king 2018-10-11
3 4 vendor_diagram 2018-08-21
4 5 venny 2018-08-13
5 6 vendtriloquist 2018-10-29

Using SQL, write a query to show the top 50% of vendors as denoted by total spend. You should return both the name and spend for this group.