当前位置:网站首页>Tourism Management System
Tourism Management System
2022-07-01 22:41:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Tourism Management System
- Introduce
- requirement :
- ER chart
- ER Figure interpretation
- ER Graph to relational pattern
- Test cases and screenshots
- Code
Introduce
Experimental assignment assigned by advanced database
requirement :
subject : Design and implement a travel reservation system , The basic information involved in the system includes flights , The taxi , Data information such as hotels and customers . Examples of entities and their characteristic attributes are as follows : FLIGHTS (String flightNum, int price, int numSeats, int numAvail, String FromCity, String ArivCity); HOTELS(String name,String location, int price, int numRooms, int numAvail); CARS(String type,String location, int price, int numCars, int numAvail); CUSTOMERS(String custName); RESERVATIONS(String custName, int resvType, String resvKey) According to my own experience, this paper gives the database design of the tourism system E/R chart ( You can add entities and attributes ), Then based on this database, complete the following functions : 1. flight , The taxi , Warehousing of basic data of hotel rooms and customers , to update . 2. Scheduled flight , The taxi , Hotel room . 3. Inquiry flight , The taxi , Hotel room , Customer and reservation information . 4. Check the travel route of a customer . 5. Any other function you want to add . requirement : 1) E/R The graph contains weak entities , Subset connection, etc , The number of meta groups in the relationship 〉=20 . 2) Submit documents :E/R Figure and explanation ,E/R Transformation and explanation from graph to relational pattern , Analyze which pattern of the given relationship belongs to NF, Then discuss its mode optimization . Completed functions and descriptions . System implementation environment . Data files and descriptions of each relational tuple . 3) Submission System : Source program and executable program , The test case .
ER chart
ER Figure interpretation
- The entity set involved in the system City : City name with attribute . customer : With attribute customer name and password . Administrators : It is a subclass entity of customers , Have all the attributes of customers . The taxi : With attribute license plate number 、 Price , Depending on the city , Is a weak entity . hotel : Hotel name with attribute 、 Price 、 Number of rooms , Depending on the city , Is a weak entity . flight : Flight number with attribute 、 Price 、 Number of seats , Depending on the city , Is a weak entity .
- Connections involved A city can have multiple hotels , So the connection between the city and the hotel is 1:N. There can be more than one taxi in a city , So the connection between city and taxi is 1:N. One city can be the departure and destination of multiple flights , Therefore, the connection between the departure and arrival of cities and flights is 1:N. A customer can book multiple hotels 、 Flights and taxis , A hotel 、 Flights and taxis can also be booked by multiple customers , So customers and hotels 、 The practice of flight and taxi is M:N.
ER Graph to relational pattern
- Urban entities can be transformed into relationships city,cityName The name of the city , It satisfies the first of the three paradigms, that is, attribute indivisibility , It satisfies the second of the three paradigms , There is a primary key . Build the predicative sentence as follows : DROP TABLE IF EXISTS
city; CREATE TABLEcity(cityNamevarchar(20) NOT NULL, PRIMARY KEY (cityName) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - Customer entities can be transformed into relationships customer,custName Indicates the customer name ,password The password ,type Used to distinguish whether it is an administrator , It satisfies the first of the three paradigms, that is, attribute indivisibility , It satisfies the second of the three paradigms , There is a primary key . Build the predicative sentence as follows : DROP TABLE IF EXISTS
customer; CREATE TABLEcustomer(passwordvarchar(50) NOT NULL,custNamevarchar(50) NOT NULL,typeint(10) DEFAULT 1, PRIMARY KEY (custName) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - Taxi entities can be converted into relationships car,carNum Indicates the license plate number ,price It means the price , The connection between city and taxi is 1:N, The connection can be expressed by foreign keys , namely cityName, Represents the city to which it belongs , It satisfies the first of the three paradigms, that is, attribute indivisibility , It satisfies the second of the three paradigms , There is a primary key , Information related to the city through foreign keys , No redundant information , That is to meet the requirements of the third paradigm . Build the predicative sentence as follows : DROP TABLE IF EXISTS
car; CREATE TABLEcar(carNumvarchar(50) NOT NULL,priceint(10) DEFAULT 0,cityNamevarchar(50) NOT NULL, PRIMARY KEY (carNum), CONSTRAINTcarcityNameFOREIGN KEY (cityName) REFERENCEScity(cityName) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - Hotel entities can be converted into relationships hotel,hotelName Is the name of the hotel ,price It means the price ,numRooms Indicates the number of rooms . The connection between the city and the hotel is 1:N, The connection can be expressed by foreign keys , namely cityName, Represents the city to which it belongs , It satisfies the first of the three paradigms, that is, attribute indivisibility , It satisfies the second of the three paradigms , There is a primary key , Information related to the city through foreign keys , No redundant information , That is to meet the requirements of the third paradigm . Build the predicative sentence as follows : DROP TABLE IF EXISTS
hotel; CREATE TABLEhotel(hotelNamevarchar(50) NOT NULL,priceint(10) DEFAULT 0,numRoomsint(10) DEFAULT 0,cityNamevarchar(50) NOT NULL, PRIMARY KEY (hotelName), CONSTRAINThotelcityNameFOREIGN KEY (cityName) REFERENCEScity(cityName) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - Flight entities can be converted into relationships flight,flightNum Indicates flight number ,price It means the price ,numSeats Indicates the number of seats , The connection between the city and the departure place of the flight is 1:N, The connection can be expressed by foreign keys , namely fromCity, Represents the city of departure , The destination contact between the city and the flight is 1:N, The connection can be expressed by foreign keys , namely arivCity, Represents the city of arrival , It satisfies the first of the three paradigms, that is, attribute indivisibility , It satisfies the second of the three paradigms , There is a primary key , Information related to the city through foreign keys , No redundant information , That is to meet the requirements of the third paradigm . Build the predicative sentence as follows : DROP TABLE IF EXISTS
flight; CREATE TABLEflight(flightNumvarchar(20) DEFAULT NULL,priceint(10) DEFAULT 0,numSeatsint(10) DEFAULT 0,fromCityvarchar(50) NOT NULL,arivCityvarchar(50) NOT NULL, PRIMARY KEY (flightNum), CONSTRAINTfromCityFOREIGN KEY (fromCity) REFERENCEScity(cityName) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINTarivCityFOREIGN KEY (arivCity) REFERENCEScity(cityName) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - Customers and hotels 、 The booking connection between flights and taxis can be transformed into a relationship reservation,resvKey Indicates the license plate number or flight number or hotel name of the reservation ,custName It's a foreign key , It means the customer ,resDate Represents the date of the appointment , It satisfies the first of the three paradigms, that is, attribute indivisibility , It satisfies the second of the three paradigms , There is a primary key , Information related to users through foreign keys , No redundant information , That is to meet the requirements of the third paradigm . Build the predicative sentence as follows : DROP TABLE IF EXISTS
reservation; CREATE TABLEreservation(resvKeyvarchar(50) NOT NULL,custNamevarchar(50) NOT NULL,typeint(10) NOT NULL,resDateDATE, KEYreservationkey(resvKey,custName,type,resDate), CONSTRAINTreservationcustFOREIGN KEY (custName) REFERENCEScustomer(custName) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Test cases and screenshots
- Sign up and log in operation : Enter your username and password , Click Register to register , Click login to login .
- home page : operation : After successful login , Enter the homepage personal Center , You can see that the home page is empty , Because we haven't booked a flight yet 、 Hotels and taxis . Make an appointment first , To see the effect .
- Book a flight operation : Click flight reservation , You can enter the flight reservation interface . Enter the departure and destination and date , Click query to book a flight , Pictured , After the appointment , You can see the remaining tickets -1, In order to see the effect later , We then make an appointment for tickets from Shanghai to Wuhan , Then make an appointment for tickets from Wuhan to Chengdu , The screenshot is similar to , Here's the picture :
- Book a hotel operation : Click on hotel reservation , You can enter the hotel reservation interface , Enter the city name and date query , Click on appointment , After making an appointment, you can see the number of remaining rooms -1.
- Book a taxi operation : Click taxi reservation , You can enter the taxi reservation interface , Enter the city name and date query , Click on appointment , After the successful appointment, you can see that one taxi is missing on the same day .
- Personal center operation : Click on personal Center , You can see all your reserved items , And you can cancel your appointment . In my trip, I can see my route map . Click to cancel the flight from Wuhan to Chengdu , You can see the following effect .
- Flight management operation : Log in with an administrator account , There is a built-in admin user , password admin, After logging in , You can see the following differences , Click flight management , You can add or delete flights .
- Hotel Management operation : Log in with an administrator account , There is a built-in admin user , password admin, Click Hotel Management , You can add or delete hotels .
- Taxi Management operation : Log in with an administrator account , There is a built-in admin user , password admin, Click taxi management , Taxis can be added or deleted .
Code
See github link
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/130303.html Link to the original text :https://javaforall.cn
边栏推荐
- 详解LockSupport的使用
- Mask wearing detection method based on yolov5
- pytorch训练自己网络后可视化特征图谱的代码
- Slope compensation
- 记录一次spark on yarn 任务报错 Operation category READ is not supported in state standby
- Is PMP certificate really useful?
- Redis配置与优化
- Mysql database detailed learning tutorial
- RestTemplate 远程调用工具类
- Sonic云真机学习总结6 - 1.4.1服务端、agent端部署
猜你喜欢

leetcode - 287. 寻找重复数

对象内存布局

Pytorch sharpening chapter | argmax and argmin functions

keras训练的H5模型转tflite
![[intelligent QBD risk assessment tool] Shanghai daoning brings you leanqbd introduction, trial and tutorial](/img/ac/655fd534ef7ab9d991d8fe1c884853.png)
[intelligent QBD risk assessment tool] Shanghai daoning brings you leanqbd introduction, trial and tutorial

Appium automated testing foundation - Supplement: introduction to desired capabilities parameters

Selection of all-optical technology in the park - Part 2

GenICam GenTL 标准 ver1.5(4)第五章 采集引擎

Configure filter

CIO's discussion and Analysis on the definition of high-performance it team
随机推荐
LC669. 修剪二叉搜索树
How to write a performance test plan
13th Blue Bridge Cup group B national tournament
Mysql——》Innodb存储引擎的索引
Show member variables and methods in classes in idea
【图像分割】2021-SegFormer NeurIPS
QT 使用FFmpeg4将argb的Qimage转换成YUV422P
MySQL MHA high availability configuration and failover
flink sql-client 使用 对照并熟悉官方文档
Dark horse programmer - software testing - stage 06 2-linux and database-01-08 Chapter 1 - description of the content of the Linux operating system stage, description of the basic format and common fo
切面条 C语言
Indicator trap: seven KPI mistakes that it leaders are prone to make
Is PMP certificate really useful?
GaussDB(DWS)主动预防排查
LC501. 二叉搜索树中的众数
【MySQL】索引的创建、查看和删除
Mask wearing detection method based on yolov5
多种智能指针
Ida dynamic debugging apk
Wechat open platform scanning code login [easy to understand]