use AdventureWorks2014 select * from production.TransactionHistory where ActualCost >0 order by ProductID desc select TOP 3 LocationID, count(*) as liczba from Production.ProductInventory group by LocationID order by liczba desc select l.name, pi.quantity, p.listprice, p.color from production.location as l join production.ProductInventory as pi on pi.locationID = l.locationID Join Production.Product as p on p.ProductID = pi.ProductID select sm.Name, count(*) from sales.SalesOrderHeader as soh join purchasing.ShipMethod as sm on sm.ShipMethodID= soh.ShipMethodID group by sm.Name select p.name as nazwaproduktu, listprice, l.name from production.ProductInventory as pinv join production.location as l on l.locationID = pinv.locationid join production.product as p on p.productId=pinv.productid select sm.name, count(*) as liczba from sales.SalesOrderHeader as soh join Purchasing.ShipMethod as sm on sm.ShipMethodID = soh.ShipMethodID group by sm.name order by liczba desc select * from Production.ProductInventory select * from Production.Product select * from sales.SalesOrderHeader select * from Purchasing.ShipMethod select sm.name, count (*) as liczba from sales.SalesOrderHeader as soh join Purchasing.ShipMethod as SM on sm.ShipMethodID = soh.ShipMethodID group by sm.Name