Você está na página 1de 13

1 st Presentation Travel Agency

6st November 2013

The Project Database


The project consists of an application for a tourism

agency. The first part of it is building the database, which will store data about the stayings, destinations and users. The following function will be implemented: Registration of the user and adding it to the database User authentication which will be able to modify the data Adding/modifying of a staying for a user

A user can log in, the database will be updated after

each new registration A user can log in, having the possibility of modifying his own profile after authentication A user can visualize trips, search, evaluate and buy The staying will be added to the basket, and additional information will be required in order to finish the session The user can evaluate trips by giving votes, grades For each staying, the user can subscribe with impressions, opinions, suggestions

The user can modify the database only after he has

logged in (e.g. making a reservation for a staying). When a reservation is made, it is inserted in the database in the Rezervare table, but at the same time the Sejur table is opened, and a suitable Staying is looked up. If this staying exists, therefore the number of available places is larger than the number of the desired reservation number to be made, then the reservation will be made, and the table Sejur will be updated with the number of available places left.

The Database was created as it follows: Utilizator Table


create table Utilizator ( CNP varchar(13) primary key, numeUtilizator varchar(100) not null, parola varchar(100) not null, email varchar(100), educatie varchar(100), varsta int, profesie varchar(100), unique(numeUtilizator) );

After inputing the required data, the user can receive

suggestions related to the staying he can choose, according to its occupation, studies, age. The next table contains information about the stayings offer. This contains the destination, departure date, duration of the staying, price, hotel, arriving date. There can be also introduced pictures with the location, landscape, hotel.

Sejur Table

create table Sejur ( idSejur int primary key auto_increment, destinatie varchar(100), traseu varchar(200), hotel varchar(100), dataPlecare datetime, durata int, pret int, nrLocuri int, nota double, dataIntroducere datetime, urlPoza varchar(100),
);

Utilizator_Sejur Table

create table Utilizator_Sejur( CNP varchar(13), idSejur int not null, vot int, constraint Utilizator_Sejur_PK primary key (CNP,idSejur), constraint legaturaUtilizator_SejurUtilizator foreign key(CNP) references Utilizator(CNP) on delete cascade, constraint legaturaSejurUtilizator_Sejur foreign key(idSejur) references Sejur(idSejur) on delete cascade );

Tag Table

create table Tag ( caracteristica varchar(50) primary key, descriere varchar(200) );

Caracteristici Table

create table Caracteristici ( CNP varchar(13), idSejur int not null, caracteristica varchar(50), nota int, constraint Caracteristici_PK primary key (CNP,idSejur,caracteristica), constraint legaturaCaracteristiciUtilizator foreign key(CNP) references Utilizator(CNP) on delete cascade, constraint legaturaSejurCaracteristici foreign key(idSejur) references Sejur(idSejur) on delete cascade, constraint legaturaTagCaracteristici foreign key(caracteristica) references Tag(caracteristica) on delete cascade );

Rezervare Table

create table Rezervare ( idRezervare int primary key auto_increment, CNP varchar(13), idExcursie int, nrLocuri int, pret int, data datetime, anulat bool, constraint legaturaRezervareUtilizator foreign key(CNP) references Utilizator(CNP) on delete cascade, constraint legaturaSejurUtilizator foreign key(idSejur) references Sejur(idSejur) on delete cascade );

Anulare Table

create table Anulare ( idAnulare int primary key auto_increment, idRezervare int not null, data datetime, constraint legaturaAnulareRezervare foreign key(idRezervare) references Rezervare(idRezervare) on delete cascade );

Você também pode gostar