-- zadanie 1 rozw. pierwsze
select distinct ProductName
from Products P join [Order Details] OD on P.ProductID=OD.ProductID
where OrderID in (select OD.OrderID
from [Order Details] OD
join Products P on OD.ProductID=P.ProductID
where ProductName = 'Chai')
and ProductName not like 'Chai'
order by 1
-- zadanie 1 rozw. drugie
select distinct w.ProductName,e.productname
from
(select ProductName, od.Orderid
from Products p join [order details] od on p.productId=od.productId
where productname ='chai')w
join(select distinct productname,od.orderid
from Products p join [order details] od on p.productId=od.productId)e
on w.orderid=e.orderid
where e.productname not in ('chai')
-- zadanie 2
select ProductName
from Products
where SupplierID in (select S.SupplierID
from Suppliers S join Products P on S.SupplierID=P.SupplierID
where ProductName like 'Chai') and ProductName not like 'Chai'