· 8 years ago · Apr 19, 2018, 10:56 AM
1drop database if exists powtorka;
2create database if not exists powtorka;
3use powtorka;
4
5create table impreza(
6id integer not null primary key,
7nazwa varchar(128) not null,
8termin datetime not null,
9opis varchar(1024)
10);
11
12create table klient(
13id integer not null primary key,
14imie varchar(32) not null,
15nazwisko varchar(32) not null,
16tel varchar(32),
17email varchar(254)
18);
19
20create table rodzajBiletu(
21id tinyint not null primary key,
22nazwa varchar(32) not null
23);
24
25create table bilet(
26id integer not null primary key,
27imprezaId integer not null,
28rodzajBiletuId tinyint not null
29);
30
31create table fromaPlatnosci(
32id tinyint not null primary key,
33nazwa varchar(32) not null
34);
35
36create table sprzedaz(
37id integer not null primary key,
38klientId integer not null,
39biletId integer not null,
40formaPlatnosciId tinyint not null,
41dataPlatnosci datetime not null,
42dataZwrotu datetime
43);