SELECT * FROM Grad WHERE Naziv LIKE 'Osijek'; SELECT * FROM Kupac WHERE (Ime = 'Ana' or Ime = 'Tamara') and GradID = '2'; --- UPDATE Kupac SET Prezime = Prezime + ' treći' WHERE Ime = 'Gary' and Prezime = 'Vargas'; SELECT * FROM Kupac WHERE Prezime LIKE 'Vargastreći' --- SELECT * FROM Kupac WHERE Prezime LIKE 'D%re%'; --- SELECT TOP 50 PERCENT k.Prezime FROM Kupac as k WHERE Ime LIKE 'Jack'; --- UPDATE Kupac set Prezime = Prezime + ' nema' where Prezime Not like '% %' select * from Kupac where Prezime like '% nema' --- SELECT p.BrojProizvoda FROM Proizvod as p WHERE p.BrojProizvoda LIKE '%g%%' escape 'g'; --- Jako dobar primjer INNER JOINa SELECT r.DatumIzdavanja as 'Datum', k.Ime, s.UkupnaCijena FROM Racun as r INNER JOIN Kupac as k ON r.KupacID = k.IDKupac INNER JOIN Stavka as s ON r.IDRacun = s.RacunID; --- SELECT k.Ime, p.Naziv AS 'Ime Proizvoda' FROM Kupac AS k INNER JOIN Racun AS r ON k.IDKupac = r.KupacID INNER JOIN Stavka AS s ON r.IDRacun = s.RacunID INNER JOIN Proizvod AS p ON s.ProizvodID = p.IDProizvod WHERE k.IDKupac = '66'; -- SELECT DISTINCT k.Tip FROM KreditnaKartica as k INNER JOIN Racun as r ON k.IDKreditnaKartica = r.KreditnaKarticaID INNER JOIN Stavka as s ON s.RacunID = r.IDRacun INNER JOIN Proizvod as p ON s.ProizvodID = p.IDProizvod WHERE p.CijenaBezPDV >= 3000