CREATE TABLE DAN (IDDAN NUMERIC(5) NOT NULL, DATUM DATE NOT NULL, PRIMARY KEY (IDDAN));
CREATE TABLE LEKAR (IDLEK NUMERIC(5) NOT NULL, IME VARCHAR(20) NOT NULL, OBLAST VARCHAR(20) NOT NULL, PRIMARY KEY (IDLEK));
CREATE TABLE OSTVARENOST (IDOST NUMERIC(5) NOT NULL, INDIKATOR NUMERIC(5) NOT NULL, PRIMARY KEY (IDOST));
CREATE TABLE PACIJENT (IDPAC NUMERIC(5) NOT NULL, IME VARCHAR(20) NOT NULL, POL VARCHAR(20) NOT NULL, UZRAST NUMERIC(5) NOT NULL, PRIMARY KEY (IDPAC));
CREATE TABLE TERMIN (IDVRE NUMERIC(5) NOT NULL, IDPAC NUMERIC(5) NOT NULL, IDOST NUMERIC(5) NOT NULL, IDTER NUMERIC(5) NOT NULL, IZNOS NUMERIC(5) NOT NULL, PRIMARY KEY (IDVRE, IDPAC, IDOST, IDTER));
CREATE TABLE TERMINVEZA (IDTER NUMERIC(5) NOT NULL, PRIMARY KEY (IDTER));
CREATE TABLE TRETMAN (IDDAN NUMERIC(5) NOT NULL, IDPAC NUMERIC(5) NOT NULL, IDLEK NUMERIC(5) NOT NULL, IDUSL NUMERIC(5) NOT NULL, IDTER NUMERIC(5) NOT NULL, IZNOS NUMERIC(5) NOT NULL, PRIMARY KEY (IDDAN, IDPAC, IDLEK, IDUSL, IDTER));
CREATE TABLE USLUGA (IDUSL NUMERIC(5) NOT NULL, NAZIV VARCHAR(30), NAZIVPODOBL VARCHAR(30), NAZIVOBL VARCHAR(30), PRIMARY KEY (IDUSL));
CREATE TABLE VREME (IDVRE NUMERIC(5) NOT NULL, DATUM DATE NOT NULL, SAT NUMERIC(5) NOT NULL, PRIMARY KEY (IDVRE));


INSERT INTO DAN (IDDAN, DATUM) 
	VALUES (1, '2009-01-02');
INSERT INTO DAN (IDDAN, DATUM) 
	VALUES (2, '2009-02-23');
INSERT INTO DAN (IDDAN, DATUM) 
	VALUES (3, '2009-03-12');
INSERT INTO DAN (IDDAN, DATUM) 
	VALUES (4, '2009-03-23');
INSERT INTO DAN (IDDAN, DATUM) 
	VALUES (5, '2009-04-24');
INSERT INTO DAN (IDDAN, DATUM) 
	VALUES (6, '2009-05-11');
INSERT INTO DAN (IDDAN, DATUM) 
	VALUES (7, '2009-07-12');
INSERT INTO DAN (IDDAN, DATUM) 
	VALUES (8, '2009-07-26');
INSERT INTO DAN (IDDAN, DATUM) 
	VALUES (9, '2009-09-12');

INSERT INTO LEKAR (IDLEK, IME, OBLAST) 
	VALUES (1, 'Marko Milicevic', 'pedijatar');
INSERT INTO LEKAR (IDLEK, IME, OBLAST) 
	VALUES (2, 'Ana Misic', 'kardiolog');
INSERT INTO LEKAR (IDLEK, IME, OBLAST) 
	VALUES (3, 'Marija Despotovic', 'ginekolog');
INSERT INTO LEKAR (IDLEK, IME, OBLAST) 
	VALUES (4, 'Marko Pavlovic', 'ortoped');
INSERT INTO LEKAR (IDLEK, IME, OBLAST) 
	VALUES (5, 'Nina Saponjic', 'zubar');
INSERT INTO LEKAR (IDLEK, IME, OBLAST) 
	VALUES (6, 'Risto Nesic', 'neurolog');
INSERT INTO LEKAR (IDLEK, IME, OBLAST) 
	VALUES (7, 'Nemanja Rasic', 'psiholog');
INSERT INTO LEKAR (IDLEK, IME, OBLAST) 
	VALUES (8, 'Goga Sekulic', 'psihijatar');

INSERT INTO OSTVARENOST (IDOST, INDIKATOR) 
	VALUES (1, 1);
INSERT INTO OSTVARENOST (IDOST, INDIKATOR) 
	VALUES (2, 0);

INSERT INTO PACIJENT (IDPAC, IME, POL, UZRAST) 
	VALUES (1, 'Marko Markovic', 'musko', 18);
INSERT INTO PACIJENT (IDPAC, IME, POL, UZRAST) 
	VALUES (2, 'Nikola Nikolic', 'musko', 23);
INSERT INTO PACIJENT (IDPAC, IME, POL, UZRAST) 
	VALUES (3, 'Kosta Perovic', 'musko', 20);
INSERT INTO PACIJENT (IDPAC, IME, POL, UZRAST) 
	VALUES (4, 'Novica Velickovic', 'musko', 22);
INSERT INTO PACIJENT (IDPAC, IME, POL, UZRAST) 
	VALUES (5, 'Milenko Tepic', 'musko', 24);
INSERT INTO PACIJENT (IDPAC, IME, POL, UZRAST) 
	VALUES (6, 'Nada Markovic', 'zensko', 35);
INSERT INTO PACIJENT (IDPAC, IME, POL, UZRAST) 
	VALUES (7, 'Snezana Nikolic', 'zensko', 40);
INSERT INTO PACIJENT (IDPAC, IME, POL, UZRAST) 
	VALUES (8, 'Natasa Vasilic', 'zensko', 55);
INSERT INTO PACIJENT (IDPAC, IME, POL, UZRAST) 
	VALUES (9, 'Marija Rakic', 'zensko', 60);

INSERT INTO TERMIN (IDVRE, IDPAC, IDOST, IDTER, IZNOS) 
	VALUES (1, 3, 1, 4, 2000);
INSERT INTO TERMIN (IDVRE, IDPAC, IDOST, IDTER, IZNOS) 
	VALUES (3, 7, 1, 8, 2050);
INSERT INTO TERMIN (IDVRE, IDPAC, IDOST, IDTER, IZNOS) 
	VALUES (5, 9, 2, 1, 0);
INSERT INTO TERMIN (IDVRE, IDPAC, IDOST, IDTER, IZNOS) 
	VALUES (6, 4, 1, 9, 3000);
INSERT INTO TERMIN (IDVRE, IDPAC, IDOST, IDTER, IZNOS) 
	VALUES (2, 1, 2, 2, 0);
INSERT INTO TERMIN (IDVRE, IDPAC, IDOST, IDTER, IZNOS) 
	VALUES (9, 6, 1, 5, 1000);

INSERT INTO TERMINVEZA (IDTER) 
	VALUES (1);
INSERT INTO TERMINVEZA (IDTER) 
	VALUES (2);
INSERT INTO TERMINVEZA (IDTER) 
	VALUES (3);
INSERT INTO TERMINVEZA (IDTER) 
	VALUES (4);
INSERT INTO TERMINVEZA (IDTER) 
	VALUES (5);
INSERT INTO TERMINVEZA (IDTER) 
	VALUES (6);
INSERT INTO TERMINVEZA (IDTER) 
	VALUES (7);
INSERT INTO TERMINVEZA (IDTER) 
	VALUES (8);
INSERT INTO TERMINVEZA (IDTER) 
	VALUES (9);

INSERT INTO TRETMAN (IDDAN, IDPAC, IDLEK, IDUSL, IDTER, IZNOS) 
	VALUES (1, 7, 6, 4, 4, 2000);
INSERT INTO TRETMAN (IDDAN, IDPAC, IDLEK, IDUSL, IDTER, IZNOS) 
	VALUES (2, 3, 4, 2, 2, 1500);
INSERT INTO TRETMAN (IDDAN, IDPAC, IDLEK, IDUSL, IDTER, IZNOS) 
	VALUES (3, 4, 8, 7, 1, 2500);
INSERT INTO TRETMAN (IDDAN, IDPAC, IDLEK, IDUSL, IDTER, IZNOS) 
	VALUES (4, 6, 1, 5, 5, 3500);
INSERT INTO TRETMAN (IDDAN, IDPAC, IDLEK, IDUSL, IDTER, IZNOS) 
	VALUES (6, 1, 3, 6, 8, 2500);
INSERT INTO TRETMAN (IDDAN, IDPAC, IDLEK, IDUSL, IDTER, IZNOS) 
	VALUES (7, 9, 4, 2, 9, 1000);
INSERT INTO TRETMAN (IDDAN, IDPAC, IDLEK, IDUSL, IDTER, IZNOS) 
	VALUES (8, 2, 2, 1, 3, 3000);
INSERT INTO TRETMAN (IDDAN, IDPAC, IDLEK, IDUSL, IDTER, IZNOS) 
	VALUES (9, 1, 6, 3, 6, 1500);

INSERT INTO USLUGA (IDUSL, NAZIV, NAZIVPODOBL, NAZIVOBL) 
	VALUES (1, 'pregled', 'glava', 'psihijatar');
INSERT INTO USLUGA (IDUSL, NAZIV, NAZIVPODOBL, NAZIVOBL) 
	VALUES (2, 'terapija', 'aritmija', 'kardiolog');
INSERT INTO USLUGA (IDUSL, NAZIV, NAZIVPODOBL, NAZIVOBL) 
	VALUES (3, 'operacija', 'aritmija', 'kardiolog');
INSERT INTO USLUGA (IDUSL, NAZIV, NAZIVPODOBL, NAZIVOBL) 
	VALUES (4, 'previjanje', 'noga', 'ortoped');
INSERT INTO USLUGA (IDUSL, NAZIV, NAZIVPODOBL, NAZIVOBL) 
	VALUES (5, 'ultrazvuk', 'aritmija', 'ginekolog');
INSERT INTO USLUGA (IDUSL, NAZIV, NAZIVPODOBL, NAZIVOBL) 
	VALUES (6, 'pregled', 'aritmija', 'kardiolog');
INSERT INTO USLUGA (IDUSL, NAZIV, NAZIVPODOBL, NAZIVOBL) 
	VALUES (7, 'previjanje', 'ruka', 'ortoped');

INSERT INTO VREME (IDVRE, DATUM, SAT) 
	VALUES (1, '2009-01-10', 8);
INSERT INTO VREME (IDVRE, DATUM, SAT) 
	VALUES (2, '2009-01-12', 9);
INSERT INTO VREME (IDVRE, DATUM, SAT) 
	VALUES (3, '2009-02-14', 10);
INSERT INTO VREME (IDVRE, DATUM, SAT) 
	VALUES (4, '2009-04-16', 11);
INSERT INTO VREME (IDVRE, DATUM, SAT) 
	VALUES (5, '2009-05-17', 12);
INSERT INTO VREME (IDVRE, DATUM, SAT) 
	VALUES (6, '2009-05-15', 11);
INSERT INTO VREME (IDVRE, DATUM, SAT) 
	VALUES (7, '2009-05-17', 8);
INSERT INTO VREME (IDVRE, DATUM, SAT) 
	VALUES (8, '2009-06-20', 9);
INSERT INTO VREME (IDVRE, DATUM, SAT) 
	VALUES (9, '2009-06-26', 14);
