DBMS RMS report
DBMS RMS report
A PROJECT REPORT
Submitted by
BONAFIDE CERTIFICATE
Certified to be the bonafide record of work done by Manish Anand of 4th semester 2nd year
B.TECH degree course in SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY, NCR Campus of Department of Computer Science & Engineering in
Database Management Systems Lab, during the academic year 2023-2024.
SIGNATURE SIGNATURE
BONAFIDE CERTIFICATE
Certified to be the bonafide record of work done by Utkarsh Gupta of 4th semester 2nd year
B.TECH degree course in SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY, NCR Campus of Department of Computer Science & Engineering in
Database Management Systems Lab, during the academic year 2023-2024.
SIGNATURE SIGNATURE
BONAFIDE CERTIFICATE
Certified to be the bonafide record of work done by Sukriti Shukla of 4th semester 2nd
year B.TECH degree course in SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY, NCR Campus of Department of Computer Science & Engineering in
Database Management Systems Lab, during the academic year 2023-2024.
SIGNATURE SIGNATURE
BONAFIDE CERTIFICATE
Certified to be the bonafide record of work done by Archi Jaiswal of 4th semester
2nd year B.TECH degree course in SRM INSTITUTE OF SCIENCE AND
TECHNOLOGY, NCR Campus of Department of Computer Science & Engineering in
Database Management Systems Lab, during the academic year 2023-2024.
SIGNATURE SIGNATURE
Ms. Swati Sheron Dr. Avneesh Vashistha
Assistant Professor Head of the Department
Computer Science & Engineering Computer Science & Engineering
Table of Contents
ABSTRACT
The Residency Management System (RMS) is a Java-based
software solution with MySQL for database management,
designed to automate and streamline the management of residency
programs in various institutions.
INTRODUCTION
1. Resident
• Description: The Resident entity represents a collection of details
about the residents (admin or users) of the residency.
• Attributes:
o r_id: A unique identifier for each resident, serving as a
primary key for the Resident entity. It distinguishes one
resident from another in the database. o name: A
composite attribute comprising two sub-
attributes that collectively represent the user’s name. It includes:
▪ FirstName: The first name of the user.
▪ LastName: The last name of the user. o l-id: A foreign
attribute that references from the login entity.
o DoB: The date of birth of the user. o gender: The gender
of the user, male or female. o r_role: The role of the user
whether they are just an user or admin of the residency.
o phone_no: The phone number of the user. o email: The
email of the user.
o r-address: The address of the user within the society.
2. ComplaintList
• Description: The ComplaintList entity is a weak entity that
depends on the login table for its details. It represents the
complaints made by the users on the application. It contains
information about each complaint made, including the l_id of the
user, the problem, its description and the date & time when the
complaint was placed.
• Attributes:
o l_id: The complaints are defined by their l_id. o problem: This
contains the main problem or the issue of registering a complaint.
o description: The details about the complaint or the problem.
o date_time: The date & time whem the complaint was resgistered.
3. Login_Details
• Description: The Login_details entity contains the details that an
user will use to get into the application, whether they are an user
or admin.
• Attributes:
o l_id: This attribute uniquely defines each entry in this table. o
Idname: This is the username that the user will use to login. o
Password: The password to their profile.
COMPLETE ER DIAGRAM:
Relationships:
1. Resident can complaint:
• One-to-many relationship from Resident to ComplaintList
(one resident can have multiple complaints)
• Total Participation of ComplaintList (Every Complaint must be
associated with a resident)
• Partial Participation of Resident ( A resident may or may not have
a resident)
2. Resident has Login_Details:
• One-to-one relationship from Resident to Login_Details (One
resident can be associated with one login and a login can have
only one resident)
• Total Participation of Resident (Every resident must belong to a
login)
• Total Participation of Login_Details ( Every login must have a
resident)
Table: Login_Details
Table: Resident
3. Entity: ComplaintList
It is a weak entity, so we include the primary key of the
Login_Details table as a foreign key in the ComplaintList table.
Also, since it has a many to one relation with Login_Details entity.
Table: ComplaintList
SQL Queries
SQL Constraints:
1. Primary Key:
CREATE TABLE Login_Details(
l_id integer primary key, Idname
varchar(50),
password varchar(50)
);
By declaring l_id as the primary key, you ensure that each user in the
Login_Details table can be uniquely identified by their l_id. This
helps maintain data integrity and enables efficient data retrieval and
manipulation operations.
2. Unique:
CREATE TABLE Login_Details( l_id
integer primary key unique, Idname
varchar(50),
password varchar(50)
);
By adding a unique constraint to the l_id column, you ensure that each
l_id in the Login_Details table must be unique. This constraint helps
maintain data integrity by preventing duplicate l_id from being entered
into the table. It also allows for efficient querying of l_id, as the
database management system (DBMS) automatically creates a unique
index on the column to enforce uniqueness.
3. Not Null:
4. Foreign Key:
CREATE TABLE ComplaintList(
l_id integer references Login_details(l_id),
problem varchar(50), description
varchar(255),
date_time datetime
);
By adding this foreign key constraint, you establish a relationship between the
ComplaintList table and the Login_Details table.
Specifically, it ensures referential integrity by enforcing that every value
in the Has column of the ComplaintList table must correspond to a valid
l_id value in the Login_details table. This constraint helps maintain
data consistency and prevents orphaned records in the database.
5. Default:
CREATE TABLE ComplaintList(
l_id integer references Login_details(l_id),
problem varchar(50), description
varchar(255),
date_time datetime default current_timestamp
);
By adding a default constraint to the date_time column, you ensure that
every complaint in the ComplaintList table will have a date & time
value, even if one is not explicitly provided during insertion. This helps
maintain data consistency and prevents NULL values from being
inserted into the column. Additionally, it simplifies data entry by
providing a default value that can be overridden if necessary.
6. Check:
CREATE TABLE Login_Details( l_id
integer primary key unique, Idname
varchar(50) not null, password
varchar(50) not null,
constraint check_length check(length(password)>=8)
);
1: Table: Login_Details
We can introduce a multivalued dependency by adding a new attribute to
the Login_Details table called Complains, where multiple Complains
can be registered.
l_id idname PASSWORD Complains
1 Ishita26 ********* Electricity
problem,
Parking issues,
Pest Control
2 anshika ********* Noise
Complains,
Neighbour
Dispute
l_id Complains
1 Parking issues
2 Noise Complains
1 Pest Control
1 Electricity problem
2 Neighbour Dispute
•
Table: Login_Details_Complain
Result:
This is the home page, that the user will see as soon as they open their
application.
• If the user chooses the “Login” option, then they can access the features
through their login credentials.
If the user does not have a login id, then he/she will go on the “New
Login” page, they can create their login id from there.
When the complaint details are filled, a dialogue box will appear
informing you about the complaint being registered successfully.
•
Logout: On logging out of your profile, this dialogue box will appear
telling you that you have been logged out, and it will take you to the
• Complaints:
This page will show all the complaints that have been registered by the
residents, in the latest to oldest order.
•
Logout: This page will show that you have been logged out of your
application and it will take you back to the main page of the application.
•
Conclusion: