Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

MY homework requires “Via a single SELECT query display the total

MY homework requires “Via a single SELECT query display the total

count of sales, by model and then by zip code, with the
highest values first”.
I can produce the information on 2 separate select inquiries, but cannot find a way to produce the required output all together. I have attached a sample of my code below, when i execute it shows duplicated of model. when i run each inquiry separate it shows exactly what i need.

select *
from(
select model, count(*) as “Sales by Model”
from vehicles
inner join sales
on sales.vin=vehicles.vin
group by vehicles.model
order by count(vehicles.model) desc),
(
select zip, count(*) as “Sales by Zip”
from customers
inner join sales
on sales.cust_id=customers.cust_id
group by customers.zip
order by count(customers.zip) desc)

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"