0% found this document useful (0 votes)
16 views16 pages

Project Rdbms (1) Maen

80 % human readbale

Uploaded by

amitbhai.mscit24
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)
16 views16 pages

Project Rdbms (1) Maen

80 % human readbale

Uploaded by

amitbhai.mscit24
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/ 16

SKIPS University

School of Computer Science

M.Sc. (Information Technology) - Batch 2024- 26

SOCS010102
Relational Database Management System

Project Title : Housekeeping Management

Date: 31/12/2024

Submitted by: Submitted to:


Amit Bavaliya Dr. Bhavin Shah
(2426003) Director, MSC IT

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 1


Table of Contents
SECTION PAGE
NUMBER
1. SYSTEM ANALYSIS
- IDENTIFICATION OF ENTITIES, ATTRIBUTES, AND 3
RELATIONSHIPS
- DATA DICTIONARY 3

- RELATIONSHIPS 6
2. ENTITY RELATIONSHIP DIAGRAM 8

3. COMMNAND 9
- DDL COMMANDS 9
- ALTER TABLE COMMANDS 9

- DROP TABLE COMMANDS 10


4. DATA MANIPULATION 10

- BASIC CRUD OPERATIONS 10


- FILTERING, SORTING, AND GROUPING 11

- JOINS 11
- SET OPERATIONS 11

5. NORMALIZATION 12

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 2


Introduction
The Housekeeping Management System is a comprehensive database solution
designed to streamline and automate housekeeping operations. It facilitates the
efficient management of staff, rooms, cleaning tasks, maintenance requests,
inventory, and scheduling. This system is ideal for organizations such as hotels,
resorts, or large facilities, where housekeeping plays a critical role in maintaining
quality standards and ensuring operational efficiency.

Requirement : Vrut Talsaniya (2426047)

Features of the System

1. Staff Management:
o Maintain detailed records of staff members, including their roles,
shifts, and assignments.
o Facilitate task allocation and scheduling for cleaning and maintenance
operations.

2. Room Management:
o Track the status, type, and occupancy of rooms.
o Monitor rooms requiring cleaning or maintenance services.

3. Task Management:
o Automate the scheduling and tracking of cleaning and maintenance
tasks.
o Record task details, including descriptions, assignments, and
completion dates.

4. Inventory Management:
o Keep track of housekeeping supplies, their availability, and associated
suppliers.
o Manage restocking requirements and monitor inventory usage.

5. Maintenance Requests:
o Log maintenance issues, prioritize tasks, and assign them to
appropriate staff.
o Track the status and resolution of maintenance requests.

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 3


6. Supplier Management:
o Store supplier details, including contact information and inventory
links.
o Manage relationships with suppliers for seamless inventory
procurement.

7. Scheduling System:
o Organize staff shifts and room-specific tasks based on schedules.
o Ensure timely task completion by integrating schedules with task
allocation.

8. Data Relationships and Integrity:


o Establish strong relational links between staff, rooms, tasks, inventory,
and schedules.
o Maintain consistency and accuracy in data management.

1. Analyzing the System: Identification of Entities,


Attributes, and Relationships
1.Data Dictionary

1 Staff Table
Attribute Data Type Constraint Description
StaffID INT(3) PRIMARY Unique identifier for each staff member
KEY
Name VARCHAR(15) NOT NULL Full name of the staff member
Position VARCHAR(15) NOT NULL Role or position (e.g., cleaner, manager)
PhoneNumber INT(10) UNIQUE Contact phone number
KEY
Email VARCHAR(20) UNIQUE Email address
KEY
HireDate DATE NOT NULL Date the staff member was hired

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 4


2 Room Table

Attribute Data Type Constraint Description


RoomID INT(3) PRIMARY KEY Unique identifier for each room
Room_NUMBER VARCHAR2(4) UNIQUE KEY Room number as displayed
Floor INT(2) NOT NULL Floor number where the room is
located
RoomType VARCHAR2(15) NOT NULL Type of room (e.g., single, suite)
OccupancyStatus VARCHAR2(15) NOT NULL Current status (e.g., occupied,
vacant)

3. Cleaning Tasks Table


Attribute Data Type Constraint Description
TaskID INT(3) PRIMARY KEY Unique identifier for
each cleaning task
StaffID INT(3) FOREIGN KEY References StaffID in
Staff Table
RoomID INT(4) FOREIGN KEY References RoomID in
Rooms Table
TaskDescription VARCHAR2(30) NOT NULL Details of the cleaning
task
TaskDate DATE NOT NULL Date the task is
scheduled or completed
CompletionStatus VARCHAR2(15) NOT NULL Status of the task (e.g.,
pending)

4. Inventory Table
Attribute Data Type Constraint Description
ItemID INT(3) PRIMARY KEY Unique identifier for each
inventory item
ItemName VARCHAR2(20) NOT NULL Name of the inventory item
Quantity INT(3) NOT NULL Current quantity in stock
SupplierID INT(3) FOREIGN KEY References SupplierID in
Suppliers Table
RestockThreshold INT(3) NOT NULL Minimum quantity before
restock is needed
LastRestockedDate DATE NOT NULL Last date when the item was
restocked

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 5


5. Maintence Requsest Table

Attribute Data Type Constraint Description


RequestID INT(3) NOT NULL Unique identifier for each
request
RoomID INT(4) FOREIGN KEY References RoomID in
Rooms Table
AssignedStaffID INT(3) NOT NULL References StaffID in Staff
Table
RequestDescription VARCHAR2(25) NOT NULL Details of the maintenance
issue
RequestDate DATE NOT NULL Date the request was created
PriorityLevel VARCHAR2(20) NOT NULL Priority level (e.g., low, high,
urgent)
CompletionStatu VARCHAR2(20) NOT NULL Status of the request (e.g.,
completed)

6. Suppliers Table
Attribute Data Type Constraint Description
SupplierID INT(3) PRIMARY KEY Unique identifier for each
supplier
SupplierName VARCHAR2(20) NOT NULL Name of the supplier
ContactPerson VARCHAR2(20) NOT NULL Primary contact person's name
PhoneNumber INT(10) NOT NULL Contact phone number
Email VARCHAR2(20) UNIQUE KEY Email address for
correspondence
Address VARCHAR2(20) NOT NULL Address of the supplier

7. Schedules table

Attribute Data Type Constraint Description


ScheduleID INT(3) PRIMARY KEY Unique identifier for each
schedule
StaffID INT(3) FOREIGN KEY References StaffID in Staff
Table
RoomID INT(4) FOREIGN KEY References RoomID in
Rooms Table
ScheduledDate DATE NOT NULL Date of the scheduled task
TaskType VARCHAR2(20) NOT NULL Type of task (e.g., cleaning,
maintenance)

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 6


TaskDetails VARCHAR2(20) NOT NULL Additional details of the
scheduled task
2. Relationship

Relationships Between Tables.

1. Staff Table ↔ CleaningTasks Table

Type: One-to-Many (1:M)

Relationship: One staff member can be assigned multiple cleaning


tasks, but each cleaning task is assigned to only one staff member.

2. Staff Table ↔ MaintenanceRequests Table

Type: One-to-Many (1:M)

Relationship: One staff member can handle multiple maintenance requests,


but each request is assigned to only one staff member.

3. Staff Table ↔ Schedules Table

Type: One-to-Many (1:M)

Relationship: One staff member can have multiple schedule entries, but each
schedule entry involves only one staff member.

4. Rooms Table ↔ CleaningTasks Table

Type: One-to-Many (1:M)

Relationship: One room can have multiple cleaning tasks, but each cleaning
task is associated with only one room.

5. Rooms Table ↔ MaintenanceRequests Table

Type: One-to-Many (1:M)

Relationship: One room can have multiple maintenance requests, but each
maintenance request is associated with only one room

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 7


6. Rooms Table ↔ Schedules Table

Type: One-to-Many (1:M)

Relationship: One room can have multiple schedule entries, but each schedule
entry is linked to only one room.

7. Suppliers Table ↔ Inventory Table

Type: One-to-Many (1:M)

Relationship: One supplier can provide multiple inventory items, but each
inventory item is supplied by only one supplier.

In the provided schema, the weak entities are:

1. Tasks (depends on Staff and Rooms).


2. Schedules (depends on Staff and Rooms).
3. MaintenanceRequests (depends on Rooms and Staff).
4. Inventory (depends on Suppliers)

When to Use Draw.io with Chen’s Notation

 Database Design: For conceptual database models.


 Project Planning: To visualize relationships between system components.
 Documentation: To include in reports for clarity.

Features:

i) Support for Chen’s Notation


ii) Easy to Use
iii) Collaborative Features
iv) Free and Browser-Based
v) Supports Advanced Features

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 8


2 ENTITY RELATIONSHIP DIAGRAM

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 9


3. COMMANDS.
DML Command .
1) Remove a schedule entry.
Ans): DELETE FROM Schedules WHERE ScheduleID =’1’ ;

2) Delete all completed cleaning tasks.


Ans): DELETE FROM CleaningTasks WHERE CompletionStatus = 'Completed';

3) Reassign a Cleaning Task(Assign a cleaning task to a different staff member).


Ans): UPDATE CleaningTasks SET StaffID = 2 WHERE TaskID = ‘ 1’;

4) Update Room Occupancy Status(Change the occupancy status of a room to


"Occupied").
Ans): UPDATE Rooms SET OccupancyStatus = 'Occupied' WHERE RoomID =
101;

5) Insert into Rooms Table.


Ans) INSERT INTO Rooms (RoomID, RoomNumber, Floor, RoomType,
OccupancyStatus) VALUES (101, 'A101', 1, 'Single', 'Vacant'), (102, 'A102', 1,
'Suite', 'Occupied'), (103, 'B201', 2, 'Double', 'Vacant');

6) Insert into Staff Table.


Ans) INSERT INTO Staff (StaffID, Name, Position, PhoneNumber, Email,
HireDate) VALUES (1, 'Alice Johnson', 'Cleaner', '1234567890',
'[email protected]', '2022-01-01'), (2, 'Bob Smith', 'Maintenance',
'0987654321', '[email protected]', '2022-03-15'), (3, 'Carol White',
'Supervisor', '5555671234', '[email protected]', '2021-05-10');

DDL Command.

7) Create Suppliers Table.


Ans) CREATE TABLE Suppliers
( SupplierID INT PRIMARY KEY, SupplierName
VARCHAR(100) NOT NULL, ContactPerson VARCHAR(100),
PhoneNumber VARCHAR(15), Email VARCHAR(100),
Address VARCHAR(255) );

8) Add a New Column(Add a Salary column to the Staff table)

Ans) ALTER TABLE Staff ADD Salary DECIMAL(10, 2);

9) Drop a Column(Remove the TaskDetails column from the Schedules table).

Ans) ALTER TABLE Schedules DROP COLUMN TaskDetails;

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 10


10) Rename a Column(Rename the CompletionStatus column in the CleaningTasks
table to TaskStatus)

Ans) ALTER TABLE CleaningTasks RENAME COLUMN CompletionStatus TO


TaskStatus;

4. Data Manipulation.

Filtering, Sorting, and Grouping


1) . Filtering

i) ( Get all staff members with the position "Manager”).


Ans) SELECT * FROM Staff WHERE Position = 'Manager';

ii) Get all rooms that are vacant.


ans) SELECT * FROM Rooms WHERE OccupancyStatus = 'Vacant';

2) Sorting:
i) (List all staff members ordered by their hire date (oldest to newest).
Ans) SELECT * FROM Staff ORDER BY HireDate ASC;

ii) List all rooms sorted by floor and room number.


Ans) SELECT * FROM Rooms ORDER BY Floor ASC, RoomNumber ASC;

3) Grouping:
i) (Count the number of staff members in each position).
Ans) SELECT Position, COUNT(*) AS StaffCount FROM Staff GROUP BY
Position;

ii) Count the number of rooms by room type.


Ans) SELECT RoomType, COUNT(*) AS RoomCount FROM Rooms GROUP
BY RoomType;

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 11


3. Joins
1). Get all tasks along with the names of the staff assigned to them.
Ans) SELECT t.TaskID, t.TaskDescription, s.Name AS StaffName, t.TaskDate,
t.CompletionStatus FROM Tasks t INNER JOIN Staff s ON t.StaffID = s.StaffID;
2). Find pairs of staff members working in the same position
Ans) SELECT s1.Name AS Staff1, s2.Name AS Staff2, s1.Position FROM Staff s1
INNER JOIN Staff s2 ON s1.Position = s2.Position AND s1.StaffID < s2.StaffID;

4. Set Operations
1). UNION

i) Get a combined list of all staff names and supplier names (distinct values).

Ans) SELECT Name AS E.ntityName FROM Staff UNION SELECT SupplierName


AS EntityName FROM Suppliers;

2). INTERSECT

ii) Find names that exist both as staff names and supplier names.

Ans) SELECT Name AS CommonName FROM Staff INTERSECT SELECT


SupplierName AS CommonName FROM Suppliers;

3). EXCEPT

iii) Get all room numbers that are not assigned to any task.

Ans) SELECT RoomNumber FROM Rooms EXCEPT SELECT r.RoomNumber


FROM Tasks t INNER JOIN Rooms r ON t.RoomID = r.RoomID;

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 12


5. Normalization
NF requires that:

 Each table has a primary key.


 All attributes contain atomic (indivisible) values.
 Each record must be unique, meaning no duplicate rows are allowed.

From the schema you provided, all tables already follow 1NF since each attribute
contains atomic values, and there are primary keys for each table.

Step 2: Second Normal Form (2NF)

2NF requires:

 The table must be in 1NF.


 All non-key attributes must be fully dependent on the primary key. This means there
should be no partial dependency, where non-key attributes depend on only part of a
composite key.

Let's review each table for 2NF:

1. Staff Table: Already in 2NF because all non-key attributes (Name, Position,
PhoneNumber, Email, HireDate) are fully dependent on the primary key
(StaffID).

2. Rooms Table: Already in 2NF since all non-key attributes (RoomNumber,


Floor, RoomType, OccupancyStatus) depend entirely on the primary key
(RoomID).

3. Tasks Table: No partial dependency here either. The non-key attributes


(StaffID, RoomID, TaskDescription, TaskDate, CompletionStatus) depend
entirely on the primary key (TaskID).

4. Inventory Table: The non-key attributes (ItemName, Quantity, SupplierID,


RestockThreshold, LastRestockedDate) are fully dependent on the primary
key (ItemID).

5. MaintenanceRequests Table: No partial dependency here. All attributes


depend on the primary key (RequestID).

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 13


6. Suppliers Table: Non-key attributes (SupplierName, ContactPerson,
PhoneNumber, Email, Address) depend entirely on the primary key
(SupplierID).

7. Schedules Table: The non-key attributes (StaffID, RoomID, ScheduledDate,


TaskType, TaskDetails) depend entirely on the primary key (ScheduleID).

Thus, all tables are in 2NF.

Step 3: Third Normal Form (3NF)

3NF requires:

 The table must be in 2NF.


 There should be no transitive dependency, meaning non-key attributes should not
depend on other non-key attributes.

Let's examine each table for 3NF:

1. Staff Table: There is no transitive dependency, so it's in 3NF.


2. Rooms Table: Similarly, no transitive dependency, so it’s in 3NF.
3. Tasks Table: No transitive dependencies, so it's in 3NF.
4. Inventory Table: No transitive dependencies. The SupplierID refers to the
Suppliers table, but no non-key attribute in the Inventory table depends on
another non-key attribute, so it's in 3NF.
5. MaintenanceRequests Table: The attributes are directly dependent on
RequestID, so no transitive dependency exists, and the table is in 3NF.
6. Suppliers Table: All attributes are directly dependent on SupplierID, so no
transitive dependency, and the table is in 3NF.
7. Schedules Table: No transitive dependency, so it’s in 3NF.

Summary of Normalized Tables:

 Staff Table
o StaffID (Primary Key)
o Name
o Position
o PhoneNumber (Unique)
o Email (Unique)
o HireDate

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 14


 Rooms Table
o RoomID (Primary Key)
o RoomNumber (Unique)
o Floor
o RoomType
o OccupancyStatus

 Tasks Table
o TaskID (Primary Key)
o StaffID (Foreign Key)
o RoomID (Foreign Key)
o TaskDescription
o TaskDate
o CompletionStatus

 Inventory Table
o ItemID (Primary Key)
o ItemName
o Quantity
o SupplierID (Foreign Key)
o RestockThreshold
o LastRestockedDate

 MaintenanceRequests Table
o RequestID (Primary Key)
o RoomID (Foreign Key)
o AssignedStaffID (Foreign Key)
o RequestDescription
o RequestDate
o PriorityLevel
o CompletionStatus

 Suppliers Table
o SupplierID (Primary Key)
o SupplierName
o ContactPerson
o PhoneNumber (Unique)
o Email (Unique)
o Address

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 15


 Schedules Table
o ScheduleID (Primary Key)
o StaffID (Foreign Key)
o RoomID (Foreign Key)
o ScheduledDate
o TaskType
o TaskDetails

Conclusion

Your database schema appears to be well-structured and already adheres to 3NF. The
tables avoid redundancy and ensure that all non-key attributes are fully dependent on
the primary key, with no transitive dependencies. This structure will help ensure data
consistency, minimize duplication, and enhance the efficiency of queries.

RDBMS|PROJECT-I HOUSEKEEPING MANAGEMENT SYSTEM 16

You might also like