projektSBDnowy.txt
- Data Base Project
- CAR SERVICE
- Craeting of tables
aeate table types ( id_type number(3) primary key, type varchar(20) not nuli, model varchar2(20) not nuli, engine_type varchar2(10) not nuli, engine_volume number(4) not nuli);
create table dients ( id_dient number(3) primary key, na me varchar2(20) not nuli, sumame varchar2(25) not nuli, address varchar2(50) not nuli, firm varchar2(25));
aeate table cars (
id_car number(3) primary key,
year_of_prod number(4) not nuli,
id_type number(2) references types not nuli,
id_owner number(3) references dients not nuli,
reg_nr varchar2(10) not nuli);
aeate table parts (
id_part number(4) primary key,
part_name varchar2(30) not nuli,
idjype number(3) references types not nuli,
price number{4) not nuli,
in_stock number(2) not nuli);
aeate table workers ( id_worker number(2) primary key, position varchar2(30) not nuli, name varchar2(20) not nuli, sumame varchar2(25) not nuli, address varchar2(50) not nuli, date_of_birtri datę, date_of_hire datę not nuli);
create table services (
id_service number(3) primary key,
name varchar2(50) not nuli,
id_worker number(2) references workers not nuli,
price number(4) not nuli);
aeate table orders (
id_order number(5) primary key,
id_service number(3) references services not nuli,
id_car number(3) references cars not nuli,
date_of datę not nuli,
price number(5) not nuli);
create table service_parts ( id_service_part number(5) primary key, id_service number(3) references services not nuli, id_part number(4) references parts not nuli);
~ Tnggers
--very simple trigger that show info after inserting a new worker
Strona 1