USE AdventureWorksOBP; SELECT k.Ime, k.Email, g.Naziv, d.Naziv FROM Kupac as k INNER JOIN Grad as g ON k.GradID = g.IDGrad RIGHT JOIN Drzava as d ON d.IDDrzava = g.DrzavaID SELECT d.Naziv, COUNT(k.IDKupac) FROM Drzava as d FULL OUTER JOIN Grad as g ON g.DrzavaID = d.IDDrzava INNER JOIN Kupac as k ON k.GradID = g.IDGrad GROUP BY d.Naziv SELECT p.Naziv, COUNT(k.IDKupac) FROM Proizvod as p INNER JOIN Stavka as s ON s.ProizvodID = P.IDProizvod INNER JOIN Racun as r ON r.IDRacun = s.RacunID INNER JOIN Kupac as k ON r.KupacID = k.IDKupac GROUP BY p.Naziv HAVING COUNT(k.IDKupac) > 300 ORDER BY COUNT(k.IDKupac) ASC