Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Hotel: Class for managing the branch hotel, and contact of each hotel
  2. a. hotelID: is a code name for branch hotel
  3. b. hotelName: branch hotel name
  4. c. hoteManagerID: shows the Staff ID of manager of the branch hotel
  5. d. hotelAddress: information of the branch 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. employeeID: code for each staff
  10. b. hotelID: identify which branch hotel the employee worked for
  11. c. employeeName: Employee 's name
  12. d. employeePosition: the work of employee (Receptionist, accountant, manager, cleaner,…)
  13. e. employeeSalary: the monthly salary of the employee
  14. f. employeePhone: the contact number
  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. customerID: an ID that was given to customer when booking and check in (may use identification number)
  19. b. customerName: Customer's name
  20. c. customerPhone: the contact number
  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. 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. hotelID: the branch hotel that have the room
  26. c. roomType: the type of the room
  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.
  29.  
  30. Booking: This table manage the booking record and the current customer in the hotel also
  31. a. bookingID: The booking code auto increase from 1
  32. b. customerID: ID of the customer made the booking
  33. c. roomID: ID of the booked room
  34. d. hotelID: ID of the hotel
  35. e. bookingDate: the date the booking is made
  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
  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
  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. serviceID: The service code auto increase from 1
  45. b. customerID: ID of the customer requests the service
  46. c. time: Time 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
  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:
  54. b. customerID: we can extract the customer data from id
  55. c. roomFee: calculated by the Check out time
  56. d. totalServiceFee: calculated from service during the time customer in the hotel
  57. e. totalPayment: Total sum of Room Fee and Service Fee
  58.  
  59. III/ Implementation:
  60. CREATE TABLE Hotel (
  61. hotelID nchar(10) PRIMARY KEY,
  62. hotalName nchar(20),
  63. hotelManagerID nchar(10),
  64. hotelAddress nchar(20),
  65. hotelPhone nchar(20));
  66.  
  67. CREATE TABLE Customer (
  68. customerID nchar(10) PRIMARY KEY,
  69. customerName nchar(20) not null,
  70. customerPhone nchar(20),
  71. customerAddress nchar(20));
  72.  
  73. CREATE TABLE Employee (
  74. employeeID nchar(10) PRIMARY KEY,
  75. hotelID nchar(10) not null,
  76. employeeName nchar(20) not null,
  77. employeePosition nchar(15),
  78. employeeSalary real,
  79. employeePhone nchar(20),
  80. employeeAddress nchar(20),
  81. FOREIGN KEY (hotelID) REFERENCES Hotel);
  82.  
  83. CREATE TABLE Room (
  84. roomID nchar(10) PRIMARY KEY,
  85. hotelID nchar(10) not null,
  86. state binary,
  87. roomType nchar(20),
  88. roomPrice real,
  89. FOREIGN KEY (hotelID) REFERENCES Hotel );
  90.  
  91. CREATE TABLE Booking (
  92. bookingID nchar(10) PRIMARY KEY AUTO_INCREMENT,
  93. customerID nchar(10) not null,
  94. roomID nchar(10) not null,
  95. hotelID nchar(10) not null,
  96. bookingDate datetime,
  97. checkInTime datetime,
  98. checkOutTime datetime,
  99. FOREIGN KEY (customerID) REFERENCES Customer
  100. FOREIGN KEY (roomID) REFERENCES Room,
  101. FOREIGN KEY (hotelID) REFERENCES Hotel);
  102.  
  103. CREATE TABLE ServiceType (
  104. serviceType nchar(20) PRIMARY KEY,
  105. servicePrice real);
  106.  
  107. CREATE TABLE Service (
  108. serviceID nchar(10) PRIMARY KEY AUTOINCREMENT,
  109. customerID nchar(10),
  110. time datetime,
  111. serviceType nchar(20),
  112. amount int;
  113. serviceFee real,
  114. state binary,
  115. FOREIGN KEY (roomType) REFERENCES Room,
  116. FOREIGN KEY (hotelID) REFERENCES Hotel);
  117.  
  118. CREATE TABLE Payment (
  119. billNumber nchar(10) PRIMARY KEY AUTOINCREMENT,
  120. customerID nchar(10),
  121. roomFee real,
  122. totalServiceFee real,
  123. totalPayment real,
  124. FOREIGN KEY (customerID) REFERENCES Payment);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement