View difference between Paste ID: za2qNLh1 and ckz8UcL5
SHOW: | | - or go back to the newest paste.
1
Hotel: Class for managing the branch hotel, and contact of each hotel
2-
a.	Hotel_ID: is a code name for branch hotel
2+
a.	hotelID: is a code name for branch hotel
3-
b.	name: branch hotel name
3+
b.	hotelName: branch hotel name
4-
c.	manager_ID: shows the Staff ID of manager of the branch hotel
4+
c.	hoteManagerID: shows the Staff ID of manager of the branch hotel
5-
d.	address: information of the branch hotel
5+
d.	hotelAddress: information of the branch hotel
6-
e.	phoneNo: the contact number of each hotel
6+
e.	hotelPhone: the contact number of each hotel
7
8
Employee: Class to manage the information of the employee in each branch hotel.
9-
a.	Staff_ID: code for each staff
9+
a.	employeeID: code for each staff
10-
b.	Hotel_ID: identify which branch hotel the employee worked for
10+
b.	hotelID: identify which branch hotel the employee worked for
11-
c.	name: Employee 's name
11+
c.	employeeName: Employee 's name
12-
d.	position: the work of employee (Receptionist, accountant, manager, cleaner,…)
12+
d.	employeePosition: the work of employee (Receptionist, accountant, manager, cleaner,…)
13-
e.	salary: the monthly salary of the employee
13+
e.	employeeSalary: the monthly salary of the employee
14-
f.	phoneNo: the contact number
14+
f.	employeePhone: the contact number
15-
g.	address: the home address of employee
15+
g.	employeeAddress: the home address of employee
16
17
Customer: Class to manage the information of the customer in each hotel. In order to provide privacy for the customer, we only collect necessary identification information.
18-
a.	Customer_ID: an ID that was given to customer when booking and check in (may use identification number)	
18+
a.	customerID: an ID that was given to customer when booking and check in (may use identification number)	
19-
b.	name: Customer's name
19+
b.	customerName: Customer's name
20-
c.	phoneNo: the contact number
20+
c.	customerPhone: the contact number
21-
d.	address: the home address of customer (in case of return missing luggage, etc)
21+
d.	customerAddress: the home address of customer (in case of return missing luggage, etc)
22
23
Room: The table of rooms available in hotels
24-
a.	Room_ID: The room code (including the hotel indication, floor and room number, for example: E308 is the 8th room on 3rd floor of Hotel E)
24+
a.	roomID: The room code (including the hotel indication, floor and room number, for example: E308 is the 8th room on 3rd floor of Hotel E)
25-
b.	Hotel_ID: the branch hotel that have the room
25+
b.	hotelID: the branch hotel that have the room
26-
c.	RoomType: the type of the room
26+
c.	roomType: the type of the room
27-
d.	price: price per day
27+
d.	roomPrice: price per day
28-
e.	State: reserved (1) or empty (0), the room state will be changed automatically when there is a check in or check out.
28+
e.	state: reserved (1) or empty (0), the room state will be changed automatically when there is a check in or check out.
29
30
Booking: This table manage the booking record and the current customer in the hotel also
31-
a.	Booking_ID: The booking code auto increase from 1
31+
a.	bookingID: The booking code auto increase from 1
32-
b.	Customer_ID: ID of the customer made the booking
32+
b.	customerID: ID of the customer made the booking
33-
c.	Room_ID: ID of the booked room
33+
c.	roomID: ID of the booked room
34-
d.	Hotel_ID: ID of the hotel
34+
d.	hotelID: ID of the hotel
35-
e.	BookingDate: the date the booking is made
35+
e.	bookingDate: the date the booking is made
36-
f.	CheckinTime: The time the customer check in, get updated by receptionist
36+
f.	checkInTime: The time the customer check in, get updated by receptionist
37-
g.	CheckoutTime: The time the customer check out, get updated by receptionist
37+
g.	checkOutTime: The time the customer check out, get updated by receptionist
38
39
ServiceType: The table of types of service and price so that we can easily add new service or change the price.
40-
a.	ServiceType: Laundry, Served Food and Drink, etc
40+
a.	serviceType: Laundry, Served Food and Drink, etc
41-
b.	price: the price of service
41+
b.	servicePrice: the price of service
42
43
Service: The table stores the records of all the services with amount detail and Customer ID for later payment
44-
a.	Service_ID: The service code auto increase from 1
44+
a.	serviceID: The service code auto increase from 1
45-
b.	Customer_ID: ID of the customer requests the service
45+
b.	customerID: ID of the customer requests the service
46-
c.	Time: Time of service
46+
c.	time: Time of service
47-
d.	ServiceType: Type of service
47+
d.	serviceType: Type of service
48
e.	quantity: quantity of service(multiply with price of Service Type)
49-
f.	ServiceFee: calculated automatically
49+
f.	serviceFee: calculated automatically
50-
g.	State: Paid (1) or Unpaid (0)
50+
g.	state: Paid (1) or Unpaid (0)
51
52
Payment: The payment bill of customer, which is paid by the Check out time
53-
a.	BillNumber:
53+
a.	billNumber:
54-
b.	Customer_ID: we can extract the customer data from id
54+
b.	customerID: we can extract the customer data from id
55-
c.	RoomFee: calculated by the Check out time
55+
c.	roomFee: calculated by the Check out time
56-
d.	TotalService Fee: calculated from service during the time customer in the hotel
56+
d.	totalServiceFee: calculated from service during the time customer in the hotel
57-
e.	TotalPayment: Total sum of Room Fee and Service Fee
57+
e.	totalPayment: Total sum of Room Fee and Service Fee
58
59
III/ Implementation:
60
CREATE TABLE Hotel (
61-
Hotel_ID	nchar(10)	PRIMARY KEY,
61+
hotelID			nchar(10)	PRIMARY KEY,
62-
h_name	nchar(20),
62+
hotalName		nchar(20),
63-
manager_ID	nchar(10),
63+
hotelManagerID	nchar(10),
64-
address	nchar(20),
64+
hotelAddress		nchar(20),
65-
phoneNo	nchar(20));
65+
hotelPhone		nchar(20));
66
67
CREATE TABLE Customer (
68-
Customer_ID	nchar(10)	PRIMARY KEY,
68+
customerID		nchar(10)	PRIMARY KEY,
69-
name		nchar(20)	not null,
69+
customerName	nchar(20)	not null,
70-
phoneNo	nchar(20),
70+
customerPhone	nchar(20),
71-
address	nchar(20));
71+
customerAddress	nchar(20));
72
73
CREATE TABLE Employee (
74-
Staff_ID	nchar(10)	PRIMARY KEY,
74+
employeeID		nchar(10)	PRIMARY KEY,
75-
Hotel_ID	nchar(10)	not null,
75+
hotelID			nchar(10)	not null,
76-
e_name	nchar(20)	not null,
76+
employeeName	nchar(20)	not null,
77-
position	nchar(15),
77+
employeePosition	nchar(15),
78-
salary		real,
78+
employeeSalary	real,
79-
phoneNo	nchar(20),
79+
employeePhone	nchar(20),
80-
address	nchar(20),
80+
employeeAddress	nchar(20),
81-
FOREIGN KEY (Hotel_ID)	REFERENCES Hotel);
81+
FOREIGN KEY (hotelID)	REFERENCES Hotel);
82
83
CREATE TABLE Room (
84-
Room_ID	nchar(10)	 PRIMARY KEY,
84+
roomID	nchar(10)	 PRIMARY KEY,
85-
Hotel_ID	nchar(10)	not null,
85+
hotelID		nchar(10)	not null,
86-
State		binary,
86+
state		binary,
87-
RoomType	nchar(20),
87+
roomType	nchar(20),
88-
price		real,
88+
roomPrice	real,
89-
FOREIGN KEY (Hotel_ID)	REFERENCES Hotel );
89+
FOREIGN KEY (hotelID)	REFERENCES Hotel );
90
91
CREATE TABLE Booking (
92-
Booking_ID	nchar(10)	PRIMARY KEY AUTO_INCREMENT,
92+
bookingID	nchar(10)	PRIMARY KEY AUTO_INCREMENT,
93-
Customer_ID	nchar(10)	not null,
93+
customerID	nchar(10)	not null,
94-
Room_ID	nchar(10)	not null,
94+
roomID	nchar(10)	not null,
95-
Hotel_ID	nchar(10)	not null,
95+
hotelID		nchar(10)	not null,
96-
BookingDate	datetime,
96+
bookingDate	datetime,
97-
CheckinTime	datetime,
97+
checkInTime		datetime,
98-
CheckoutTime		datetime,	
98+
checkOutTime		datetime,	
99-
FOREIGN KEY (Customer_ID)	REFERENCES Customer
99+
FOREIGN KEY (customerID)		REFERENCES Customer
100-
FOREIGN KEY (Room_ID)		REFERENCES Room,
100+
FOREIGN KEY (roomID)		REFERENCES Room,
101-
FOREIGN KEY (Hotel_ID)		REFERENCES Hotel);
101+
FOREIGN KEY (hotelID)		REFERENCES Hotel);
102
103
CREATE TABLE ServiceType (
104-
ServiceType	nchar(20) 	PRIMARY KEY,
104+
serviceType	nchar(20) 	PRIMARY KEY,
105-
ServicePrice	real);
105+
servicePrice	real);
106
107
CREATE TABLE Service (
108-
Service_ID	nchar(10) PRIMARY KEY AUTOINCREMENT,
108+
serviceID	nchar(10) PRIMARY KEY AUTOINCREMENT,
109-
Customer_ID	nchar(10),
109+
customerID	nchar(10),
110-
Time		datetime,
110+
time		datetime,
111-
ServiceType	nchar(20),
111+
serviceType	nchar(20),
112
amount	int;
113-
ServiceFee	real,
113+
serviceFee	real,
114-
State		binary,
114+
state		binary,
115-
FOREIGN KEY (RoomType)	REFERENCES Room,
115+
FOREIGN KEY (roomType)	REFERENCES Room,
116-
FOREIGN KEY (Hotel_ID)	REFERENCES Hotel);
116+
FOREIGN KEY (hotelID)	REFERENCES Hotel);
117
118
CREATE TABLE Payment (
119-
BillNumber	nchar(10) PRIMARY KEY AUTOINCREMENT,
119+
billNumber	nchar(10) PRIMARY KEY AUTOINCREMENT,
120-
Customer_ID	nchar(10),
120+
customerID	nchar(10),
121-
RoomFee	real,
121+
roomFee	real,
122-
TotalServiceFee	real,
122+
totalServiceFee	real,
123-
TotalPayment		real,
123+
totalPayment		real,
124-
FOREIGN KEY (Customer_ID)	REFERENCES Payment);
124+
FOREIGN KEY (customerID)	REFERENCES Payment);