Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Database System Development Life Cycle

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

DATABASE SYSTEM DEVELOPMENT LIFE CYCLE

DATABASE PLANNING

SYSTEM DEFINITION

REQUIREMENT COLLECTION AND ANALYSIS

DATABASE DESIGN

APPLICATION DESIGN

DBMS SELECTION

PROTOTYPING

IMPLEMENTATION

DAT CONVERSION AND LOADING

TESTING

OPERATIONAL MAINTENANCE

REQUIREMENT COLLECTION AND ANALYSIS

The hotel management company operates several hotels throughout the


country. Each hotel is given a unique hotel number and the data held on
each hotel includes the hotel address composed of street, city, state, and zip
code, and the telephone number. Each hotel is allocated staff, which
includes a Manager who is responsible for the day-to-day running of a given
hotel. Each member of staff is given a staff number, which is unique
throughout the company, and the data held on a member of staff is his or her
name, position, and salary.

Each hotel has a stock of rooms. The data held on a room is the room
number, room type, daily rate, status, and the amenities available. The room
number uniquely identifies each room. However, in most cases, there are
several types of each room at a hotel, and the individual types are identified
using the room type. A room is given a category such as Single, Double,
Suite, or Deluxe. The status indicates whether a specific room is available
for booking.
Before booking a room from the company, a customer must first register as
a member of a local hotel. The data held on a member is the first and last
name, address, and the date that the member registered at a hotel. Each
member is given a member number, which is unique throughout all hotels of
the company. Once registered, a member is free to book rooms, up to a
maximum of five at any one time.

The data held on each room booked is the booking number, the full name
and number of the member, the room number, room type, and daily rate, and
the dates the room is booked and checked out. The booking number is
unique throughout the company. Information about the payment made by
the member for each booking is also stored.

Each hotel offers multiple services such as spa, restaurant, etc. and
information about these services is stored. Each member can book multiple
services and information about the services booked by the member is also
stored.

CONCEPTUAL DATABSE DESIGN

Entities:

Hotel: Each hotel is given a unique hotel number. The data held on
each hotel includes the hotel address composed of street, city, state,
and zip code, and the telephone number.

Staff: Each member of staff is given a staff number, which is unique


throughout the company. The data held on a member of staff is his or
her name, position, and salary

Manager: Each hotel is allocated a Manager who is responsible for


the day-to-day running of a given hotel. The Manager is a special
type of Staff

Room: Each hotel has a stock of rooms. The data held on a room is
the room number, room type, daily rate, status, and the amenities
available. The room number uniquely identifies each room.

Room Type: A room is given a category such as Single, Double,


Suite, or Deluxe. The individual types are identified using the room
type.

Amenities: Information about the amenities available in each room.


Member: Before booking a room from the company, a customer
must first register as a member of a local hotel. The data held on a
member is the first and last name, address, and the date that the
member registered at a hotel. Each member is given a member
number, which is unique throughout all hotels of the company.

Booking: The data held on each room booked is the booking number,
the full name and number of the member, the room number, room
type, and daily rate, and the dates the room is booked and checked
out. The booking number is unique throughout the company.

Payment: Information about the payment made by the member for


each booking.

Service: Information about the services offered by the hotel such as


spa, restaurant, etc.

Service Booking: Information about the services booked by the


member.

Relationships:

Hotel-Staff: Each hotel is allocated staff. One-to-many relationship.

Hotel-Manager: Each hotel has one manager. One-to-one


relationship.

Hotel-Room: Each hotel has multiple rooms. One-to-many


relationship.

Room-Room Type: Each room has one room type. One-to-one


relationship.

Room-Amenities: Each room has multiple amenities. One-to-many


relationship.

Hotel-Member: Members are registered to hotels. One-to-many


relationship.

Member-Booking: Each member can have multiple bookings. One-


to-many relationship.

Room-Booking: Each room can have multiple bookings. One-to-


many relationship.
Booking-Payment: Each booking has one payment. One-to-one
relationship.

Hotel-Service: Each hotel offers multiple services. One-to-many


relationship.

Member-Service Booking: Each member can book multiple


services. One-to-many relationship.

Attributes and Data Types:

 Hotel: Hotel Number (Integer), Address (String), Telephone Number


(String)
 Staff: Staff Number (Integer), Name (String), Position (String), Salary
(Decimal)
 Manager: Manager Number (Integer), Name (String), Position
(String), Salary (Decimal)
 Room: Room Number (Integer), Room Type (String), Daily Rate
(Decimal), Status (String), Amenities (String)
 Room Type: Type (String)
 Amenities: Amenity (String)
 Member: Member Number (Integer), First Name (String), Last Name
(String), Address (String), Registration Date (Date)
 Booking: Booking Number (Integer), Member Number (Integer),
Room Number (Integer), Room Type (String), Daily Rate (Decimal),
Booking Date (Date), Check Out Date (Date)
 Payment: Payment Number (Integer), Booking Number (Integer),
Amount (Decimal), Payment Date (Date)
 Service: Service Number (Integer), Service Name (String), Price
(Decimal)
 Service Booking: Service Booking Number (Integer), Member
Number (Integer), Service Number (Integer), Booking Date (Date)

LOGICAL DATABASE DESIGN


PHYSICAL DATABASE DESING

CREATE DATABASE HOTEL_MANAGEMENT_SYSTEM

-- Creating Hotel table


CREATE TABLE Hotel (
HotelNumber INT PRIMARY KEY,
Address VARCHAR(255),
TelephoneNumber VARCHAR(15)
);

-- Creating Staff table


CREATE TABLE Staff (
StaffNumber INT PRIMARY KEY,
Name VARCHAR(255),
Position VARCHAR(255),
Salary DECIMAL(10, 2),
HotelNumber INT,
FOREIGN KEY (HotelNumber) REFERENCES Hotel(HotelNumber)
);

-- Creating Manager table


CREATE TABLE Manager (
ManagerNumber INT PRIMARY KEY,
StaffNumber INT,
FOREIGN KEY (StaffNumber) REFERENCES Staff(StaffNumber)
);

-- Creating RoomType table


CREATE TABLE RoomType (
Type VARCHAR(255) PRIMARY KEY
);

-- Creating Room table


CREATE TABLE Room (
RoomNumber INT PRIMARY KEY,
RoomType VARCHAR(255),
DailyRate DECIMAL(10, 2),
Status VARCHAR(255),
Amenities VARCHAR(255),
HotelNumber INT,
FOREIGN KEY (RoomType) REFERENCES RoomType(Type),
FOREIGN KEY (HotelNumber) REFERENCES Hotel(HotelNumber)
);

-- Creating Member table


CREATE TABLE Member (
MemberNumber INT PRIMARY KEY,
FirstName VARCHAR(255),
LastName VARCHAR(255),
Address VARCHAR(255),
RegistrationDate DATE,
HotelNumber INT,
FOREIGN KEY (HotelNumber) REFERENCES Hotel(HotelNumber)
);

-- Creating Booking table


CREATE TABLE Booking (
BookingNumber INT PRIMARY KEY,
MemberNumber INT,
RoomNumber INT,
DailyRate DECIMAL(10, 2),
BookingDate DATE,
CheckOutDate DATE,
FOREIGN KEY (MemberNumber) REFERENCES Member(MemberNumber),
FOREIGN KEY (RoomNumber) REFERENCES Room(RoomNumber)
);

-- Creating Payment table


CREATE TABLE Payment (
PaymentNumber INT PRIMARY KEY,
BookingNumber INT,
Amount DECIMAL(10, 2),
PaymentDate DATE,
FOREIGN KEY (BookingNumber) REFERENCES Booking(BookingNumber)
);

-- Creating Service table


CREATE TABLE Service (
ServiceNumber INT PRIMARY KEY,
ServiceName VARCHAR(255),
Price DECIMAL(10, 2)
);

-- Creating ServiceBooking table


CREATE TABLE ServiceBooking (
ServiceBookingNumber INT PRIMARY KEY,
MemberNumber INT,
ServiceNumber INT,
BookingDate DATE,
FOREIGN KEY (MemberNumber) REFERENCES Member(MemberNumber),
FOREIGN KEY (ServiceNumber) REFERENCES Service(ServiceNumber)
);

-- Creating StaffService table


CREATE TABLE StaffService (
StaffNumber INT,
ServiceNumber INT,
PRIMARY KEY (StaffNumber, ServiceNumber),
FOREIGN KEY (StaffNumber) REFERENCES Staff(StaffNumber),
FOREIGN KEY (ServiceNumber) REFERENCES Service(ServiceNumber)
);

You might also like