Advertisement
antisa

Baze_LV3

Apr 4th, 2024 (edited)
1,164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 1.43 KB | None | 0 0
  1. SET DATEFORMAT dmy
  2. CREATE TABLE aaa_osobe_mestrovic(
  3.     ime VARCHAR(50),
  4.     prezime VARCHAR(50),
  5.     oib VARCHAR(11) PRIMARY KEY,
  6.     datum_rodenja DATETIME,
  7.     spol CHAR(1),
  8.     visina INT,
  9.     broj_cipela INT
  10. );
  11.  
  12. INSERT INTO aaa_osobe_mestrovic (ime, prezime, oib, datum_rodenja, spol, visina, broj_cipela)
  13. VALUES
  14.     ('Ante', 'Mestrovic', '11111111111', '01.01.2002', 'm', 200, 45),
  15.     ('ime', 'prezime', '11111111112', '02.02.2002', 'm', 210, 45),
  16.     ('ime', 'prezime', '11111111113', '03.02.2002', 'm', 220, 45),
  17.     ('ime', 'prezime', '11111111114', '04.01.2002', 'm', 230, 45),
  18.     ('ime', 'prezime', '11111111115', '05.01.2002', 'm', 240, 45); 
  19.  
  20. -- ---------------------------------------------------------
  21.  
  22. UPDATE aaa_osobe_mestrovic
  23. SET ime = 'NovoIme', prezime = 'NovoPrezime'
  24. WHERE oib = '11111111112';
  25.  
  26.  
  27. UPDATE aaa_osobe_mestrovic
  28. SET broj_cipela = broj_cipela + 1;
  29.  
  30.  
  31. DELETE FROM aaa_osobe_mestrovic
  32. WHERE oib = '11111111113';
  33.  
  34. -- ---------------------------------------------------------
  35.  
  36. SELECT * FROM student
  37. ORDER BY DatUpis ASC;
  38.  
  39. SELECT ime AS Ime, prezime AS Prezime
  40. FROM student
  41. WHERE DatRod < '1994-01-01';
  42.  
  43. -- ---------------------------------------------------------
  44.  
  45. SELECT ime, prezime,naziv FROM ispit, student, predmet
  46. WHERE sifPredmeta=sifra AND ocjena>=4 AND mbr=mbrStud;
  47.  
  48. -- ---------------------------------------------------------
  49.  
  50. SELECT * FROM mjesto
  51. ORDER BY Pbr ASC;
  52.  
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement