0% found this document useful (0 votes)
37 views14 pages

Team19 Main

Uploaded by

tenjeanne
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views14 pages

Team19 Main

Uploaded by

tenjeanne
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Database Management (TSN2310), Fall 2020

Term Project
Team 19
Team name: EcoTour
ID Full name Section
U1911113 Ten Janna 002
U1911116 Abdurashidov Abdulvokhid 002
U1911118* Bekchanova Aziza 002
U1911125 Kamolova Khilola 002
1. Introduction
Ecotourism is a conservation-oriented form of travel involving natural attractions in which tourism
activities must have the least environmental impact and respect local culture and lifestyles
(Donohoe & Needham, 2006; Fennell, 2001; Wallace, 2019). In order to better acquaint people
with Ecotourism, we decided to create an EcoTour application that will help tourists or local visitors
to safely find protected places that are included in the list of ecological places in Uzbekistan, learn
about them in detail, and also by visiting get a full range of services from a guide.
EcoTour is a combination of "Eco" - an abbreviated form of Ecological, and "Tour" - Tourism. The
Purpose of this app:
− Increase the awareness of these places among young travellers and encourage them to
realize the need to preserve nature;
− Popularization of the local culture, traditions, and way of life of uzbekistan to attract
travellers to visit a particular area;
− Facilitate the search for tourist spots for both tourists and locals;
The main functions of the EcoTour app:
1. A list of tourist places with detailed information about them and their history, what is
located in their territory, and what entertainment is available;
2. A list of organizations that protect these places, as well as a list of investors who have
contributed to the development of these places (in this section, if desired, people have the
opportunity to make their contribution, public or anonymous, using a dialog box that will
contact with the committee of this places);
3. Working days and hours;
4. Determination of the level of workload by people at a given hour;
5. A list of guides you can order;
6. Service package;
7. Instructions on how to get to the area;
8. A book with wishes for the improvement and development of this place;
Entity and relationship:
− Committee (It consists of many departments that are responsible for protection part and hire
guides)
− Tour (There are several tours with tour packages to organize the whole travel time)
− Guide (Person, who introduce tourists to the place according to the package and type of
tour)
− Investor (They can be public officers, committee members, corporations, or even tourists)
− Tourists (Person who takes a tour, maybe with or without a guide to visit tour place)
− Place (Protected by Committee places such as mountains, desert, park, garden and nature
reserve)
2. Design
a) Conceptual database design

b) Logical database design


c) Logical design by ERWin

d) Physical design by ERWin

3. Schemas in standard SQL


a) DDL
CREATE TABLE CAN_BE_CONDUCTED
(
tname VARCHAR(20) NOT NULL,
SSN INTEGER NOT NULL,
cname VARCHAR(100) NOT NULL,
pname VARCHAR(20) NOT NULL,
PRIMARY KEY (tname,SSN,cname,pname)
);
CREATE TABLE COMMITTEE
(
cname VARCHAR(100) NOT NULL,
function_debt_legislation VARCHAR(20) NULL,
function_debt_fact_findind VARCHAR(20) NULL,
function_debt_coordination VARCHAR(20) NULL,
function_debt_wage VARCHAR(20) NULL,
function_debt_protection VARCHAR(20) NULL,
PRIMARY KEY (cname)
);
CREATE TABLE COMMITTEE_MEMBER
(
departure VARCHAR(100) NULL,
name VARCHAR(20) NOT NULL,
PRIMARY KEY (name)
);
CREATE TABLE CONTACTS
(
contacts INTEGER NOT NULL,
ID INTEGER NOT NULL,
name VARCHAR(20) NOT NULL,
PRIMARY KEY (contacts,ID,name)
);
CREATE TABLE CORPHONE
(
phone INTEGER NOT NULL,
name VARCHAR(20) NOT NULL,
PRIMARY KEY (phone,name)
);
CREATE TABLE CORPORATION
(
name VARCHAR(20) NOT NULL,
location VARCHAR(20) NULL,
PRIMARY KEY (name)
);
CREATE TABLE CPHONE
(
phone INTEGER NOT NULL,
cname VARCHAR(100) NOT NULL,
PRIMARY KEY (phone,cname)
);
CREATE TABLE DESERT
(
type_subtropical VARCHAR(20) NULL,
type_coastal VARCHAR(20) NULL,
type_rain_shadow VARCHAR(20) NULL,
type_interior VARCHAR(20) NULL,
pname VARCHAR(20) NOT NULL,
PRIMARY KEY (pname)
);
CREATE TABLE GARDEN
(
type_organic VARCHAR(20) NULL,
type_water VARCHAR(20) NULL,
type_demonstration VARCHAR(20) NULL,
type_container VARCHAR(20) NULL,
pname VARCHAR(20) NOT NULL,
PRIMARY KEY (pname)
);
CREATE TABLE GUIDE
(
SSN INTEGER NOT NULL,
works_on_part_time VARCHAR(20) NULL,
works_on_full_time VARCHAR(20) NULL,
cname VARCHAR(100) NOT NULL,
PRIMARY KEY (SSN,cname)
);
CREATE TABLE INVESTOR
(
ID INTEGER NOT NULL,
address_street VARCHAR(40) NULL,
address_city VARCHAR(20) NULL,
address_state VARCHAR(20) NULL,
amount_of_invested_money INTEGER NULL,
cname VARCHAR(100) NULL,
name VARCHAR(20) NOT NULL,
PRIMARY KEY (ID,name)
);
CREATE TABLE MONUMENT
(
type_headstone VARCHAR(20) NULL,
type_memorial_trees VARCHAR(20) NULL,
type_cremotion_memorials VARCHAR(20) NULL,
type_plaque VARCHAR(20) NULL,
type_statue VARCHAR(20) NULL,
pname VARCHAR(20) NOT NULL,
PRIMARY KEY (pname)
);
CREATE TABLE PACKAGE
(
package VARCHAR(20) NOT NULL,
tname VARCHAR(20) NOT NULL,
SSN INTEGER NOT NULL,
cname VARCHAR(100) NOT NULL,
PRIMARY KEY (package,tname,SSN,cname)
);
CREATE TABLE PARK
(
type_national VARCHAR(20) NULL,
type_natural VARCHAR(20) NULL,
type_deontrological VARCHAR(20) NULL,
pname VARCHAR(20) NOT NULL,
PRIMARY KEY (pname)
);
CREATE TABLE PERSON
(
name VARCHAR(20) NOT NULL,
PRIMARY KEY (name)
);
CREATE TABLE PLACE
(
pname VARCHAR(20) NOT NULL,
location VARCHAR(100) NULL,
number_of_workers INTEGER NULL,
date_of_establishment DATE NULL,
cname VARCHAR(100) NOT NULL,
PRIMARY KEY (pname)
);
CREATE TABLE PUBLIC_OFFICER
(
SSN INTEGER NULL,
name VARCHAR(20) NOT NULL,
PRIMARY KEY (name)
);
CREATE TABLE RESERVE
(
type_local VARCHAR(20) NULL,
type_national VARCHAR(20) NULL,
pname VARCHAR(20) NOT NULL,
PRIMARY KEY (pname)
);
CREATE TABLE TAKES
(
name VARCHAR(20) NOT NULL,
tname VARCHAR(20) NOT NULL,
SSN INTEGER NOT NULL,
cname VARCHAR(100) NOT NULL,
time DATE NULL,
PRIMARY KEY (name,tname,SSN,cname)
);
CREATE TABLE TOUR
(
tname VARCHAR(20) NOT NULL,
type_group VARCHAR(20) NULL,
type_individual VARCHAR(20) NULL,
SSN INTEGER NOT NULL,
cname VARCHAR(100) NOT NULL,
PRIMARY KEY (tname,SSN,cname)
);
CREATE TABLE TOUR_PROGRAM
(
tour_program VARCHAR(20) NOT NULL,
SSN INTEGER NOT NULL,
cname VARCHAR(100) NOT NULL,
PRIMARY KEY (tour_program,SSN,cname)
);
CREATE TABLE TOURIST
(
check_number INTEGER NULL,
type_of_ticket_child VARCHAR(20) NULL,
type_of_ticket_adult VARCHAR(20) NULL,
name VARCHAR(20) NOT NULL,
PRIMARY KEY (name)
);
ALTER TABLE CAN_BE_CONDUCTED
ADD CONSTRAINT IN_CHARGE FOREIGN KEY (tname, SSN, cname) REFERENCES TOUR
(tname, SSN, cname);
ALTER TABLE CAN_BE_CONDUCTED
ADD CONSTRAINT BELONGS_TO FOREIGN KEY (pname) REFERENCES PLACE (pname);
ALTER TABLE COMMITTEE_MEMBER
ADD CONSTRAINT PCOMMITTEE_MEMBER FOREIGN KEY (name) REFERENCES
PERSON (name)
ON DELETE CASCADE;
ALTER TABLE CONTACTS
ADD CONSTRAINT ICONTACTS FOREIGN KEY (ID, name) REFERENCES INVESTOR (ID,
name);
ALTER TABLE CORPHONE
ADD CONSTRAINT CORPHONE FOREIGN KEY (name) REFERENCES CORPORATION
(name);
ALTER TABLE CPHONE
ADD CONSTRAINT CPHONE FOREIGN KEY (cname) REFERENCES COMMITTEE (cname);
ALTER TABLE DESERT
ADD CONSTRAINT PDESERT FOREIGN KEY (pname) REFERENCES PLACE (pname)
ON DELETE CASCADE;
ALTER TABLE GARDEN
ADD CONSTRAINT PGARDEN FOREIGN KEY (pname) REFERENCES PLACE (pname)
ON DELETE CASCADE;
ALTER TABLE GUIDE
ADD CONSTRAINT HIRES FOREIGN KEY (cname) REFERENCES COMMITTEE (cname);
ALTER TABLE INVESTOR
ADD CONSTRAINT INVEST_IN FOREIGN KEY (cname) REFERENCES COMMITTEE
(cname);
ALTER TABLE INVESTOR
ADD CONSTRAINT IPERSON FOREIGN KEY (name) REFERENCES PERSON (name);

ALTER TABLE INVESTOR


ADD CONSTRAINT ICORPORATION FOREIGN KEY (name) REFERENCES
CORPORATION (name);
ALTER TABLE MONUMENT
ADD CONSTRAINT PMONUMENT FOREIGN KEY (pname) REFERENCES PLACE (pname)
ON DELETE CASCADE;
ALTER TABLE PACKAGE
ADD CONSTRAINT TPACKAGE FOREIGN KEY (tname, SSN, cname) REFERENCES TOUR
(tname, SSN, cname);
ALTER TABLE PARK
ADD CONSTRAINT PPARK FOREIGN KEY (pname) REFERENCES PLACE (pname)
ON DELETE CASCADE;
ALTER TABLE PLACE
ADD CONSTRAINT LOOK_AFTER FOREIGN KEY (cname) REFERENCES COMMITTEE
(cname);
ALTER TABLE PUBLIC_OFFICER
ADD CONSTRAINT PPUBLIC_OFFICER FOREIGN KEY (name) REFERENCES PERSON
(name)
ON DELETE CASCADE;
ALTER TABLE RESERVE
ADD CONSTRAINT PRESERVE FOREIGN KEY (pname) REFERENCES PLACE (pname)
ON DELETE CASCADE;
ALTER TABLE TAKES;
ALTER TABLE TAKES;
ALTER TABLE TOUR
ADD CONSTRAINT PROVIDES FOREIGN KEY (SSN, cname) REFERENCES GUIDE (SSN,
cname);
ALTER TABLE TOUR_PROGRAM
ADD CONSTRAINT GTOUR_PROGRAM FOREIGN KEY (SSN, cname) REFERENCES
GUIDE (SSN, cname);
ALTER TABLE TOURIST
ADD CONSTRAINT PTOURIST FOREIGN KEY (name) REFERENCES PERSON (name)
ON DELETE CASCADE;

b) DML
insert into COMMITTEE values ('State Committee of the Republic of Uzbekistan on Ecology and
Enviromental Protection','legislation','fact_findind','coordination','wage','protection');
insert into PERSON values ('Fayziev Ravshan');
insert into PERSON values ('Aitmuratov Timurlan');
insert into PERSON values ('Iskandar Iskandarov');
insert into PERSON values ('Bazorov Jumanazar');
insert into PERSON values ('Afrodite Key');
insert into PERSON values ('Wulf Finnegan');
insert into PERSON values ('Ricmod Knopp');
insert into PERSON values ('Jeanette Barre');
insert into CORPORATION value ('Samoils','house');
insert into CORPORATION value ('Coory','house');
insert into CORPORATION value ('Lawax','flat');
insert into COMMITTEE_MEMBER values ('Specialized analytical control in the field of
environmental protection','Fayziev Ravshan');
insert into COMMITTEE_MEMBER values ('State Environmental Certification','Aitmuratov
Timurlan');
insert into COMMITTEE_MEMBER values ('State Environmental Expertise','Iskandar
Iskandarov');
insert into COMMITTEE_MEMBER values ('Eco-energy','Bazorov Jumanazar');
insert into PUBLIC_OFFICER values ('0032','Afrodite Key');
insert into PUBLIC_OFFICER values ('0058','Wulf Finnegan');
insert into PUBLIC_OFFICER values ('0097','Ricmod Knopp');
insert into TOURIST values ('1','child','null','Jeanette Barre');
insert into TOURIST values ('2','null','adult','Ricmod Knopp');
insert into TOURIST values ('3','null','adult','Bazorov Jumanazar');
insert into TAKES value ('Jeanette Barre','Around us','435','State Committee of the Republic of
Uzbekistan on Ecology and Enviromental Protection','200723');
insert into TAKES value ('Ricmod Knopp','Amazing nature','498','State Committee of the Republic
of Uzbekistan on Ecology and Enviromental Protection','200615');
insert into TAKES value ('Bazorov Jumanazar','Uncharted places','132','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protection','1200516');
insert into TAKES value ('Bazorov Jumanazar','Beautiful landscapes','534','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protection','200413');
insert into CPHONE value ('712070770','State Committee of the Republic of Uzbekistan on
Ecology and Enviromental Protection');
insert into GUIDE value ('435','null','full time','State Committee of the Republic of Uzbekistan on
Ecology and Enviromental Protection');
insert into GUIDE value ('498','null','full time','State Committee of the Republic of Uzbekistan on
Ecology and Enviromental Protection');
insert into GUIDE value ('132','part time','null','State Committee of the Republic of Uzbekistan on
Ecology and Enviromental Protection');
insert into GUIDE value ('534','part time','null','State Committee of the Republic of Uzbekistan on
Ecology and Enviromental Protection');
insert into TOUR_PROGRAM value('morning-afternoon','435','State Committee of the Republic of
Uzbekistan on Ecology and Enviromental Protection');
insert into TOUR_PROGRAM value('morning-afternoon','498','State Committee of the Republic of
Uzbekistan on Ecology and Enviromental Protection');
insert into TOUR_PROGRAM value('afternoon-evening','132','State Committee of the Republic of
Uzbekistan on Ecology and Enviromental Protection');
insert into TOUR_PROGRAM value('afternoon-evening','534','State Committee of the Republic of
Uzbekistan on Ecology and Enviromental Protection');
insert into TOUR value ('Around us','group','null','435','State Committee of the Republic of
Uzbekistan on Ecology and Enviromental Protection');
insert into TOUR value ('Amazing nature','group','null','498','State Committee of the Republic of
Uzbekistan on Ecology and Enviromental Protection');
insert into TOUR value ('Uncharted places','null','individual','132','State Committee of the Republic
of Uzbekistan on Ecology and Enviromental Protection');
insert into TOUR value ('Beautiful landscapes','null','individual','534','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into PACKAGE value ('all inclusive','Around us','435','State Committee of the Republic of
Uzbekistan on Ecology and Enviromental Protection');
insert into PACKAGE value ('all inclusive','Amazing nature','498','State Committee of the Republic
of Uzbekistan on Ecology and Enviromental Protection');
insert into PACKAGE value ('all inclusive','Uncharted places','132','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into PACKAGE value ('all inclusive','Beautiful landscapes','534','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into CORPHONE values ('971356534','Samoils');
insert into CORPHONE values ('901059532','Coory');
insert into CORPHONE values ('936579802','Lawax');
insert into PLACE value ('Nurata Reserve','northern slope of the Nuratau ridge','45','1975','State
Committee of the Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into PLACE value ('Chatkal Reserve','slope of the Chatkal ridge in the Western Tien
Shan','50','1947','State Committee of the Republic of Uzbekistan on Ecology and Enviromental
Protection');
insert into PLACE value ('Kyzylsue Reserve','northwestern slope of the Gissar
ridge','34','1975','State Committee of the Republic of Uzbekistan on Ecology and Enviromental
Protection');
insert into PLACE value ('Ugam-Chatkal park','west of Tan Shan','56','1990','State Committee of
the Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into PLACE value ('Zaamin National Park','Zaamin district','62','1976','State Committee of
the Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into PLACE value ('Botanical Garden','Bogishamol 232V','34','1943','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into PLACE value ('Japanese garden','st. Amir Temur 107','45','1947','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into PLACE value ('Kyzylkum','between Amu Darya and Syr Darya','37','null','State
Committee of the Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into PLACE value ('Ustyurt','between Mangyshlak and Kara-Bogaz-Gol in the
west','43','null','State Committee of the Republic of Uzbekistan on Ecology and Enviromental
Protection');
insert into PLACE value ('Leafy elm','Altyaryk district of Fergana region','56','1570','State
Committee of the Republic of Uzbekistan on Ecology and Enviromental Protection');
insert into PLACE value ('Amankutan forest country house','western spurs of the Zaravshan and a
number of other ridges','48','1887','State Committee of the Republic of Uzbekistan on Ecology and
Enviromental Protection');
insert into INVESTOR values ('23456','Peck Ave Plymouth','Massachusetts','USA','90000','State
Committee of the Republic of Uzbekistan on Ecology and Enviromental Protection','Samoils');
insert into INVESTOR values ('76345','Wisconsin Ave Chevy
Chase','Maryland','USA','100000','State Committee of the Republic of Uzbekistan on Ecology and
Enviromental Protection','Coory');
insert into INVESTOR values ('20568','Brentwood Dr Metairie','Louisiana','USA','120000','State
Committee of the Republic of Uzbekistan on Ecology and Enviromental Protection','Lawax');
insert into INVESTOR values ('12345','Pond Branch Rd Leesville','South
Carolina','USA','80000','State Committee of the Republic of Uzbekistan on Ecology and
Enviromental Protection','Fayziev Ravshan');
insert into INVESTOR values ('84632','Howells Rd Bay Shore','New York','USA','50000','State
Committee of the Republic of Uzbekistan on Ecology and Enviromental Protection','Aitmuratov
Timurlan');
insert into INVESTOR values ('90725','Ryans Bay Rd Zumbro
Falls','Minnesota','USA','80000','State Committee of the Republic of Uzbekistan on Ecology and
Enviromental Protection','Iskandar Iskandarov');
insert into INVESTOR values ('70534','Old Rockmart Rd SE Silver
Creek','Georgia','USA','70000','State Committee of the Republic of Uzbekistan on Ecology and
Enviromental Protection','Bazorov Jumanazar');
insert into INVESTOR values ('14365','NW Buckshire St Banks','Oregon','USA','85000','State
Committee of the Republic of Uzbekistan on Ecology and Enviromental Protection','Afrodite Key');
insert into INVESTOR values ('20945','Cambridge Rd Shingle
Springs','California','USA','90000','State Committee of the Republic of Uzbekistan on Ecology and
Enviromental Protection','Wulf Finnegan');
insert into INVESTOR values ('16534','Higdon Rd Holly Springs','Mississippi','USA','75000','State
Committee of the Republic of Uzbekistan on Ecology and Enviromental Protection','Ricmod
Knopp');
insert into INVESTOR values ('73546','Main St Arapahoe','Nebraska','USA','80000','State
Committee of the Republic of Uzbekistan on Ecology and Enviromental Protection','Jeanette
Barre');
insert into CONTACTS value ('971356534','23456','null','Samoils');
insert into CONTACTS value ('901059532','76345','null','Coory');
insert into CONTACTS value ('936579802','20568','null','Lawax');
insert into CONTACTS value ('931235689','12345','Fayziev Ravshan','null');
insert into CONTACTS value ('978763456','84632','Aitmuratov Timurlan','null');
insert into CONTACTS value ('906543456','90725','Iskandar Iskandarov','null');
insert into CONTACTS value ('935467867','70534','Bazorov Jumanazar','null');
insert into CONTACTS value ('974004678','14365','Afrodite Key','null');
insert into CONTACTS value ('935674678','20945','Wulf Finnegan','null');
insert into CONTACTS value ('901234678','16534','Ricmod Knopp','null');
insert into CONTACTS value ('909117899','73546','Jeanette Barre','null');
insert into CAN_BE_CONDUCTED value ('Around us','435','State Committee of the Republic of
Uzbekistan on Ecology and Enviromental Protectio','Nurata Reserve');
insert into CAN_BE_CONDUCTED value ('Amazing nature','498','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protectio','Botanical Garden');
insert into CAN_BE_CONDUCTED value ('Uncharted places','132','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protectio','Kyzylkum');
insert into CAN_BE_CONDUCTED value ('Beautiful landscapes','534','State Committee of the
Republic of Uzbekistan on Ecology and Enviromental Protectio','Leafy elm');
insert into RESERVE value ('local','null','Nurata Reserve');
insert into RESERVE value ('null','national','Chatkal Reserve');
insert into RESERVE value ('null','national','Kyzylsue Reserve');
insert into PARK value ('national','null','null','Ugam-Chatkal park');
insert into PARK value ('null','natural','null','Zaamin National Park');
insert into GARDEN value ('null','null','demonstration','null','Botanical Garden');
insert into GARDEN value ('null','null','demonstration','null','Japanese garden');
insert into DESERT value ('subtropical','null','null','null','Kyzylkum');
insert into DESERT value ('null','coastal','null','null','Ustyurt');
insert into MONUMENT value ('headstone','null','null','null','null','Leafy elm');
insert into MONUMENT value ('headstone','null','null','null','null','Amankutan forest country
house');

4. Testing
Query 1
a) Find the name of all places
b) SELECT pname from PLACE
c)
Query 2
a) Find the corporation phone of all corporation locations
b) SELECT location, phone
FROM CORPORATION, CORPHONE
WHERE CORPORATION.name=CORPHONE.name
c)

Query 3
a) Find the check number of all tourists who took a tour for a specific time
b) SELECT check_number, time
FROM TOURIST, TAKES
WHERE TOURIST.name=TAKES.name
c)
Query 4
a) Find locations where all tours are conducted
b) SELECT tname, location
FROM TOUR, PLACE
WHERE TOUR.cname=PLACE.cname
c)

Query 5
a) Find the tour program of all place names
b) SELECT tour_program, pname
FROM TOUR_PROGRAM, PLACE
WHERE TOUR_PROGRAM.cname=PLACE.cname
c)

You might also like