· 8 years ago · Apr 19, 2018, 11:08 AM
1drop database if exists ti3_170418;
2create database if not exists ti3_170418;
3use ti3_170418;
4
5create table impreza(id integer not null primary key, nazwa varchar(128) not null, termin datetime not null, opis varchar(1024));
6create table klient(id integer not null primary key, imie varchar(32) not null, nazwisko varchar(32) not null, tel varchar(32), email varchar(254));
7create table rodzajbiletu(id tinyint not null primary key, imprezaId integer not null, nazwa varchar(32) not null);
8create table bilet(id integer not null primary key, imprezaId integer not null, rodzajbiletuId tinyint not null);
9create table formaplatnosci(id tinyint not null primary key, nazwa varchar(32) not null);
10create table sprzedaz(id integer not null primary key, klientId integer not null, biletId integer not null, formaplatnosciId tinyint not null, dataplatnosci datetime not null, datazwrotu datetime);