-- zad 1
/*SELECT* FROM Customers
WHERE CompanyName LIKE 'C%'
AND LEN(Country)>6;*/
-- zad2
SELECT OrderId,
(UnitPrice * Quantity * 1-Discount) as value
from [Order Details];
--zad3
/*SELECT OrderID , sum(UnitPrice * Quantity * 1-Discount) as value
from [Order Details]
GROUP by OrderID;*/
--zad4
/*SELECT OrderID,
count(distinct productid)
sum(UnitPrice * Quantity * (1-Discount)) as value
from [Order Details]
GROUP by OrderID;*/
-- zad5
--select distinct OrderID, round (sum(UnitPrice * Quantity * 1-Discount),2) as value from [Order Details] GROUP by OrderID order by value desc;
-- zad6
--select SupplierID ,round(avg(UnitPrice),2) as value from Products GROUP BY SupplierID ORDER by value desc;
--select SupplierID ,round(avg(UnitPrice),2) as value from Products GROUP BY SupplierID ORDER by SupplierID;
--select SupplierID ,round(avg(UnitPrice),2) AvgPrice from Products GROUP BY SupplierID ORDER by AvgPrice ASC;
--zad7
--select ProductID, ProductName, UnitPrice from Products where Discontinued=0 and UnitPrice<12;
--zad8
--select sum(UnitPrice*UnitsInStock)from products;
--zad9
/*select avg(unitprice)avgPrice
from products
group by categoryid
having count(distinct ProductID)<10;*/
--zad10
/*select categoryid,
round(avg(unitprice),2) as srednia,
round(min(unitprice),2) as minimum,
round(max(unitprice),2) as maksimum
from products
group by CategoryID;*/
--zad11
/*select 'DE_' +companyname nazwa from Customers where country ='Germany'
Union
select 'PL_' +companyname from Customers where country = 'Poland'
union
select 'USA_' +companyname from Customers where country ='USA'
order by nazwa;*/
https://put.blinkiewicz.pl/courses/bd_lab
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}