Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create table adres (
- ID_adres int primary key,
- powiat varchar(25),
- miejscowosc varchar(30),
- ulica varchar(20),
- numer_domu int not null,
- numer_mieszkania int not null,
- wojewodztwo varchar(30)
- );
- create table pasazerowie (
- imie varchar(25),
- nazwisko varchar(30),
- pesel char(11) primary key,
- numer_telefonu int,
- constraint sprawdz_numer
- check (numer_telefonu between 99999999 and 1000000000),
- mail varchar(40),
- adres int references adres
- );
- create table bilety (
- ID_bilet int primary key,
- status_oplacenia int,
- constraint sprawdz_status
- check (status_oplacenia between 0 and 1),
- typ_bagazu int,
- ilosc_bagazu int
- );
- create table status_odpraw (
- ID_odprawy int primary key,
- typ_odprawy int,
- data_odprawy date
- );
- create table samoloty (
- ID_samolot int primary key,
- producent varchar(20),
- pojemnosc int not null
- );
- create table siedzenie (
- ID_siedzenia int primary key,
- klasa varchar(15),
- numer_siedzenia int,
- samolot int references samoloty
- );
- create table lotniska (
- ID_lotniska int primary key,
- miasto varchar(30),
- nazwa varchar(50)
- );
- create table loty_planowane (
- numer_lotu int primary key,
- miejsce_wylotu varchar(25),
- miejsce_przylotu varchar(25),
- godzina_odlotu time,
- godzina_przylotu time,
- lotnisko_przylotowe int references lotniska,
- lotnisko_docelowe int references lotniska
- );
- create table loty_faktyczne (
- ID_lotu int primary key,
- data_wylotu date,
- data_przylotu date,
- czas_faktyczny time,
- lot_planowany int references loty_planowane
- );
- create table rezerwacje (
- ID_rezerwacji int primary key,
- pasazer_id int,
- klasa_rezerwacji varchar(15),
- bilet int references bilety,
- lot_faktyczny int references loty_faktyczne
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement