sql_2.txt

(0 KB) Pobierz
create table stanowiska
(id_s number(4) primary key, nazwa varchar2(10) not null unique);

crate table wydzialy
(id_w number (4) constraint wydzialy_id_w_PK primary key, nazwa varchar2(10) not null unique);

create table osoby
(id_o number (4), 
nazwisko varchar2(10) not null,
imie varchar2(10) not null,
imie2 varchar2(10),
d_ur date not null,
plec char(1) not null, check(plec='M' or plec='K'), 
constraint osoby_id_o_PK primary key(id_o));

create table zatrudnienia 
(id_z number(4) primary key,
id_o number(4) not null references osoby(id_o),
id_w number(4) not null references wydzialy(id_w),  
od date not null,
do date,
id_s number(4) not null,
pensja number(8,2) not null,
constraint zatrudnienia_id_o_FK foreign key (id_s) references wydzialy(id_w)); 
Zgłoś jeśli naruszono regulamin