Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create database Bolnica
- create table zaposlenici(
- zaposlenikID int NOT NULL identity,
- ime varchar(255) not null,
- prezime varchar(255) not null,
- godinaRodenja date not null,
- Primary key(zaposlenikID)
- );
- INSERT INTO zaposlenici(ime,prezime,godinaRodenja)
- VALUES('Domagoj','Milardovic','1993-05-25');
- create table pacijent(
- pacijentID int NOT NULL identity,
- ime varchar(255) not null,
- prezime varchar(255) not null,
- zdravStanje varchar(255) not null,
- PacijentGodinaRodenja int not null,
- Primary key(pacijentID)
- );
- create table zanimanje(
- zanimanjeID int not null identity,
- imeZanimanje varchar(255) not null,
- placa int not null,
- PRIMARY KEY(zanimanjeID),
- );
- INSERT INTO zanimanje(imeZanimanje,placa)
- VALUES('Kirurg','15000');
- create table odjelRadi(
- odjelID int not null identity,
- imeOdjela varchar(255) not null,
- zaposlenikID int not null,
- zanimanjeID int not null,
- PRIMARY KEY(odjelID),
- FOREIGN KEY(zanimanjeID) REFERENCES zanimanje(zanimanjeID),
- FOREIGN KEY(zaposlenikID) REFERENCES zaposlenici(zaposlenikID)
- );
- create table odjelOdsjeda(
- odjelID int not null,
- pacijentID int not null,
- vrijemeUpisa date not null,
- FOREIGN KEY(odjelID) REFERENCES odjelRadi(odjelID),
- FOREIGN KEY(pacijentID) REFERENCES pacijent(pacijentID),
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement