Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. create table adres (
  2. ID_adres int primary key,
  3. powiat varchar(25),
  4. miejscowosc varchar(30),
  5. ulica varchar(20),
  6. numer_domu int not null,
  7. numer_mieszkania int not null,
  8. wojewodztwo varchar(30)
  9. );
  10.  
  11. create table pasazerowie (
  12. imie varchar(25),
  13. nazwisko varchar(30),
  14. pesel char(11) primary key,
  15. numer_telefonu int,
  16. constraint sprawdz_numer
  17. check (numer_telefonu between 99999999 and 1000000000),
  18. mail varchar(40),
  19. adres int references adres
  20. );
  21.  
  22. create table bilety (
  23. ID_bilet int primary key,
  24. status_oplacenia int,
  25. constraint sprawdz_status
  26. check (status_oplacenia between 0 and 1),
  27. typ_bagazu int,
  28. ilosc_bagazu int
  29. );
  30.  
  31. create table status_odpraw (
  32. ID_odprawy int primary key,
  33. typ_odprawy int,
  34. data_odprawy date
  35. );
  36.  
  37. create table samoloty (
  38. ID_samolot int primary key,
  39. producent varchar(20),
  40. pojemnosc int not null
  41. );
  42.  
  43. create table siedzenie (
  44. ID_siedzenia int primary key,
  45. klasa varchar(15),
  46. numer_siedzenia int,
  47. samolot int references samoloty
  48. );
  49.  
  50. create table lotniska (
  51. ID_lotniska int primary key,
  52. miasto varchar(30),
  53. nazwa varchar(50)
  54. );
  55.  
  56. create table loty_planowane (
  57. numer_lotu int primary key,
  58. miejsce_wylotu varchar(25),
  59. miejsce_przylotu varchar(25),
  60. godzina_odlotu time,
  61. godzina_przylotu time,
  62. lotnisko_przylotowe int references lotniska,
  63. lotnisko_docelowe int references lotniska
  64. );
  65.  
  66. create table loty_faktyczne (
  67. ID_lotu int primary key,
  68. data_wylotu date,
  69. data_przylotu date,
  70. czas_faktyczny time,
  71. lot_planowany int references loty_planowane
  72. );
  73.  
  74. create table rezerwacje (
  75. ID_rezerwacji int primary key,
  76. pasazer_id int,
  77. klasa_rezerwacji varchar(15),
  78. bilet int references bilety,
  79. lot_faktyczny int references loty_faktyczne
  80. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement