You are on page 1of 31

House Rental Management System (ApartLet)

A COURSE PROJECT REPORT

By

Danish Raja (RA2111003010478)

Debasish Ray (RA2111003010480)

Tushaar Yenduri (RA2111003010481)


Under the guidance of

Dr. Baranidharan B
Associate Professor, Department of Computing Technologies

In partial fulfillment for the Course 18CSC303J-


Database Management Systems
in
School of Computing

FACULTY OF ENGINEERING AND TECHNOLOGY


SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
Kattankulathur, Chengalpattu District
APRIL 2024
Acknowledgement

We would like to express our gratitude to our Professor, Dr. Baranidharan B ,who
gave us the golden opportunity to do this wonderful project related to DBMS on
the topic "HOUSE RENTAL MANAGEMENT SYSTEM" which also helped
us in doing a lot of research and we came to know about so many new things we
are really thankful to him.

We are also thankful to all the other faculty, teaching and non-teaching staff
members of our department for their kind cooperation and help.

Lastly, we would also like to thank our friends who helped us a lot in finishing
this project within the limited time. We are making this project not only for
marks but to also increase our knowledge.

Debasish Ray (RA2111003010480)

Danish Raja (RA2111003010478)

Tushaar Yenduri (RA2111003010481)


Index

CONTENTS
:-
S. Particulars Page
no no.
1. Introduction 4-5

2. Project Features and Objectives 6-7

3. Back End Design ,Front End Design and 8-12


Connectivity
4. Output 13-28

5. Applications 29

6. Conclusion 30

7. Bibliography 31
CHAPTER-1
1.INTRODUCTION

The two main sections:


Backend: codes that are written in DBML, PHP, ASP.Net to name but a few
by the developer and frontend which is markup shown by clients or users’
browsers.

For implementing our project , we should use HTML (Hyper Text Markup
Language), it just shows some elements for users and doesn't run any
functions.

When you go to a specific URL, your request is sent to your desired server and
it'll render for your HTML of the site, in fact, the server runs any server-side
functions.The Front-End used in this project is HTML along with the CSS
language. HTML is the standard markup language for creating Web pages.

● HTML stands for Hyper Text Markup Language


● HTML describes the structure of Web pages using markup
● HTML elements are the building blocks of HTML pages
● HTML elements are represented by tags
● HTML tags label pieces of content such as "heading", "paragraph", "table", and
so on
● Browsers do not display the HTML tags, but use them to render the
content of the page

1.1 Advantages of HTML:


1. The first advantage is that it is widely used.
2. Every browser supports HTML language.
3. Easy to learn and use.
4. It is by default in every window so you don't need to purchase extra
software.
5. You can integrate HTML with CSS, JavaScript, php etc.

The back-end database used in this project is MySQL


It is a language used to interrogate and process data in a relational database.
Originally developed by IBM for its mainframes, SQL commands can be used to
interactively work with a database or can be embedded within a script or
programming language as an interface to a database. Programming extensions to
SQL have turned it into a full-blown database programming language, and all
major database management systems (DBMSs) support it.
ANSI standardized SQL.
But most DBMSs have some proprietary enhancement, which if used, makes
SQL non- standard. Moving an application from one SQL database to
another sometimes requires tweaking, the age-old problem in this business!

1.2 Advantages of MySQL:


1.SQL Queries can be used to retrieve large amounts of records from a
database quickly.
2.SQL is used to view the data without storing the data into the object
3. SQL joins two or more tables and show it as one object to user
4. SQL databases use a long-established standard, which is being adopted by
ANSI & ISO. Nosql databases do not adhere to any clear standard.
CHAPTER-2
Project Features and Overview
2.1 About the Project:

ApartLet is a software application that helps landlords or property managers handle


the tasks involved in renting out or managing properties. These systems can be used
to list vacancies, screen tenants, collect rent, track maintenance requests, and
manage finances. Property management systems are especially useful for landlords
with multiple properties.

2.2 Main features are:

A House Rental Management System (HRMS) is designed to streamline the


operations of renting properties, making it easier for landlords and property
managers to oversee their rentals efficiently. The main features of this system
typically include:

● Tenant Management: HRMS allows for storing and managing all tenant
information, including personal details, rental history, and lease agreements. It
facilitates communication between landlords and tenants, and helps in tracking
tenant complaints and requests.

● Property Management: This feature enables the storage of detailed information


about each property, such as location, size, condition, and amenities. It also
helps in managing property maintenance schedules and tracking repairs.

● Lease Management: The system can handle all aspects of lease administration,
from drafting and signing leases digitally to monitoring lease expirations and
renewals. It ensures compliance with local rental laws and regulations.

● Financial Management: HRMS incorporates tools for tracking rent payments,


deposits, and expenses. It can generate financial reports, facilitating budget
management and financial planning.

● Booking and Reservations: For short-term rentals, the system can manage
bookings and check-in/check-out processes, similar to a hotel reservation
system.

● User Interface and Accessibility: A user-friendly interface ensures that both


landlords and tenants can easily navigate and use the system. Mobile
accessibility allows users to manage or inquire about their rentals anytime and
anywhere.

2.3 Objectives:

The objectives of a house management system (specifically for property


management) can be broken down into three main categories:

1. Increased Revenue and Profitability:

● Minimize vacancy periods: By efficiently marketing vacancies and


streamlining the tenant application process, the system can help you fill
vacancies faster and keep your rental income flowing.

● Maximize rent collection: The system can automate rent collection


reminders and online payment options, leading to on-time rent payments
and reduced instances of late fees.

● Reduce operating costs: The system can help you manage maintenance
requests efficiently, track expenses, and identify areas for cost savings.

2. Improved Efficiency and Time Management:

● Streamline daily tasks: Automating repetitive tasks like rent collection,


lease renewals, and sending maintenance notifications frees up your time
to focus on other important aspects of property management.

● Improved communication: The system can provide a central platform for


communication with tenants, allowing you to easily send announcements,
respond to inquiries, and manage maintenance requests.

● Centralized data management: Store all your property information, tenant


details, and financial records in one secure and easily accessible location.
CHAPTER-3
3.1 BACK-END DESIGN

3.1.1 Conceptual Database Design(ER-Diagram)

3.1.2 Logical Database Design (Schema Design)


3.1.3 1NF (First Normal Form)
First Normal Form (1NF) is a property of a relation in a relational database. A
relation is in first normal form if and only if the domain of each attribute contains
only atomic (indivisible) values, and the value of each attribute contains only a
single value from that domain.

In our database , Tenant table consists of attributes: id,


name,email,contact,house_id,status,date_in.

● So , name attribute can have two or more values, after normalizing it, the table
attributes have been modified to
“id,firstname,middlename,lastname,email,contact,house_id,status,date_in”

3.1.4 2NF (Second Normal Form)


The Second Normal Form (2NF) is based on the concept of full functional
dependency.
A relation is in 2NF if it is in 1NF and every non-prime attribute is fully
functionally dependent on the primary key. This means that there is no partial
dependency of any non-prime attribute on any proper subset of any candidate key
of the table.

● In our database,assuming that `id` is the primary key, the table is already in
2NF if none of the other attributes (`firstname`, `middle name`, `last name`,
`email`, `contact`, `house_id`, `status`, `date_in`) are dependent on a part of
the primary key. Since the primary key (`id`) is not a composite key , the table
is already in 2NF.

3.1.5 3NF (Third Normal Form)

Let's go through each table and check if they are in 2NF, 3NF, and BCNF.

● Categories Table: This table is already in 2NF, 3NF, and BCNF as there is only
one candidate key (`id`) and no non-prime attribute (`name`) is dependent on a
proper subset of any candidate key¹²⁴.
● Houses Table: This table is in 2NF and 3NF as every non-prime attribute is fully
functionally dependent on the primary key (`id`). However, if there is a
dependency between non-prime attributes (for example, if `price` is dependent
on `description`), then it would not be in BCNF.

● Payments Table: This table is in 2NF and 3NF as every non-prime attribute is
fully functionally dependent on the primary key (`id`). However, if there is a
dependency between non-prime attributes (for example, if `amount` is
dependent on `invoice`), then it would not be in BCNF.

● System_Settings Table: This table is in 2NF, 3NF, and BCNF as there is only
one candidate key (`id`) and no non-prime attribute is dependent on a proper
subset of any candidate key¹²⁴.

● Tenants Table: This table is in 2NF and 3NF as every non-prime attribute is
fully functionally dependent on the primary key (`id`). However, if there is a
dependency between non-prime attributes (for example, if `status` is dependent
on `house_id`), then it would not be in BCNF.

● Users Table: This table is in 2NF and 3NF as every non-prime attribute is fully
functionally dependent on the primary key (`id`). However, if there is a
dependency between non-prime attributes (for example, if `password` is
dependent on `username`), then it would not be in BCNF.
3.2 FRONT-END DESIGN

3.1.1 Front-end web development details

● HTML provides the basic structure of sites, which is enhanced and modified
by other technologies like CSS and JavaScript.

● CSS is used to control presentation, formatting, and layout.

● JavaScript is used to control the behavior of different elements.

HTML
HTML is at the core of every web page, regardless of the complexity of a
site or number of technologies involved. It's an essential skill for any web
professional. It's the starting point for anyone learning how to create
content for the web. And, luckily for us, it's surprisingly easy to learn.

CSS
CSS stands for Cascading Style Sheets. This programming language dictates
how the HTML elements of a website should actually appear on the frontend
of the page.

JavaScript
JavaScript is a more complicated language than HTML or CSS, and it wasn't
released in beta form until 1995. Nowadays, JavaScript is supported by all
modern web browsers and is used on almost every site on the web for more
powerful and complex functionality.
3.1.2 Connectivity (front end and Back end):
PHP is an amazing and popular language!
It is powerful enough to be at the core of the biggest blogging system on the web
(WordPress)!. It is deep enough to run the largest social network (Facebook)!,It
is also easy enough to be a beginner's first server side language!

● PHP is an acronym for "PHP: Hypertext Preprocessor"

● PHP is a widely-used, open source scripting language

● PHP scripts are executed on the server

● PHP is free to download and use

● PHP files can contain text, HTML, CSS, JavaScript, and PHP code

● PHP code are executed on the server, and the result is returned to the browser
as plain HTML

● With PHP you are not limited to output HTML. You can output images,
PDF files, and even Flash movies. You can also output any text, such as
XHTML and XML.
CHAPTER-4
OUTPUT

DDL-CREATE

DDL-DROP

House Table Execution:


House Table Entry

House Type Output Execution:


Payments Table:

Reports Table
Q1. Display all the tenants whose name starts with a D letter.

● SELECT * FROM `tenants` WHERE firstname like "D%";

Q2. Display all the payments where amount attribute lies between 40000
and 100000;

● SELECT * FROM `payments` WHERE amount BETWEEN 40000 AND


100000;

Q3. Display all the tenants.

● SELECT COUNT(*) FROM tenants;

Q4. Perform Set Operation between Payments table and Houses table.

● SELECT * FROM `payments` UNION ALL SELECT * FROM `houses`


LIMIT 0,25;

Q5. Perform Intersect Operation between Payments Table and Houses


table.

● SELECT * FROM `payments` INTERSECT SELECT * FROM `houses`


LIMIT 0,25;

Q6. Display the max number of price of houses with only house_no and
price attribute in house table.

● SELECT house_no,price FROM `houses` WHERE price < 50000;

Q7. Count the number of categories_name in categories table.

● SELECT COUNT(*) AS no_of_houses FROM categories;

Q8. Display the no of houses as category “Estancia” and price is greater


than 30000 in house table.
● SELECT COUNT(*) AS no_of_houses FROM houses WHERE
description like 'Estancia%' AND price>30000;

Q9. Display the tenants who belong to SRM and took a house-flat between
July-2023 and January 2024.

● SELECT * FROM `tenants` WHERE email LIKE '%@srmist.edu.in' AND


date_in BETWEEN '2023-07-06' AND '2024-01-01' LIMIT 0, 25;

Q10. Count the number of categories with category_id and group them
according to it.

● SELECT COUNT(category_id) as categories FROM `houses` GROUP


BY category_id;
Use of Functions (string/text, numeric)

1. Round off price to two decimal places as rounded_price from houses


(table-houses)

● SELECT ROUND(price,2) AS rounded_price FROM houses;

2. Display average amount calculated from all the existing payments as


average_payment from payments (table-payments)
● SELECT AVG(amount) AS average_payment FROM payments;
Use of set operations (union, intersect, difference/minus)

3. Display a union of elements as full_name including first name of the


tenant and the last name of the tenant (table-tenant)
● SELECT firstname AS full_name FROM tenants UNION SELECT
lastname FROM tenants;
4. Display intersection of category ids from houses (houses-table) and
intersect ids from categories(categories-table)
● SELECT category_id FROM houses INTERSECT SELECT id FROM
categories;
Use of Nested Queries

5. Display id and house number of the most expensive house from houses
(houses-table)
● Select id, house_no from houses where price=(select max(price) from
houses);
6. To find the average payment amount made by tenants in an
apartment :
● SELECT AVG(amount) AS avg_payment FROM payments WHERE
tenant_id IN ( SELECT id FROM tenants WHERE house_id IN
( SELECT id FROM houses WHERE category_id = (SELECT id FROM
categories WHERE name = 'Apartment') ) );
Use of Procedures and Triggers

7. Create a procedure to
insert_payment(tenant_id,amount,invoice,date,category_id)

DELIMITER //

CREATE PROCEDURE insert_payment(


IN p_tenant_id INT,
IN p_amount DECIMAL(10, 2),
IN p_invoice VARCHAR(100),
IN p_date_created DATE,
IN p_category_id INT
)
BEGIN
DECLARE tenant_check INT;
DECLARE category_check INT;
-- Check if the tenant exists
SELECT COUNT(*) INTO tenant_check FROM tenants WHERE id =
p_tenant_id;
IF tenant_check = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Tenant does
not exist';
END IF;

-- Check if the category exists


SELECT COUNT(*) INTO category_check FROM categories WHERE
id = p_category_id;
IF category_check = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Category
does not exist';
END IF;

-- Insert payment record


INSERT INTO payments (tenant_id, amount, invoice, date_created,
category_id)
VALUES (p_tenant_id, p_amount, p_invoice, p_date_created,
p_category_id);

SELECT 'Payment inserted successfully' AS result;


END//

DELIMITER ;
8. Create a procedure process_payments that validates payments using
cursors.

DELIMITER //

CREATE PROCEDURE process_payments()


BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE tenant_id INT;
DECLARE payment_amount DECIMAL(10, 2);
DECLARE invoice_no VARCHAR(100);
DECLARE payment_date DATE;
DECLARE category_id INT;

DECLARE cur CURSOR FOR SELECT tenant_id, amount, invoice,


date_created, category_id FROM payments;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done =
TRUE;

OPEN cur;

payment_loop: WHILE NOT done DO


FETCH cur INTO tenant_id, payment_amount, invoice_no,
payment_date, category_id;

IF NOT done THEN


-- Check if the tenant exists
IF EXISTS (SELECT * FROM tenants WHERE id = tenant_id)
THEN
-- Check if the category exists
IF EXISTS (SELECT * FROM categories WHERE id =
category_id) THEN
-- Process payment here, e.g., send email, update balances,
etc.
-- For demonstration purposes, let's print the payment
details
SELECT CONCAT('Processing payment for tenant_id: ',
tenant_id, ', amount: ', payment_amount, ', invoice: ', invoice_no, ',
date_created: ', payment_date, ', category_id: ', category_id) AS
message;
ELSE
SELECT CONCAT('Category with id ', category_id, ' does
not exist') AS message;
END IF;
ELSE
SELECT CONCAT('Tenant with id ', tenant_id, ' does not
exist') AS message;
END IF;
END IF;
END WHILE payment_loop;

CLOSE cur;
END//
DELIMITER ;

CHAPTER-5
APPLICATIONS

Five potential applications for the project involving rental property management:

1. Rental Property Management Software: Develop a web or desktop application


that enables landlords or property managers to efficiently manage their rental
properties, including tracking tenant information, managing payments,
generating invoices, and monitoring property vacancies.

2. Tenant Portal: Create a tenant portal where tenants can log in to view their lease
agreements, make rental payments online, submit maintenance requests, and
communicate with their landlords or property managers.

3. Financial Reporting Tool: Build a reporting tool that provides landlords with
insights into their rental property finances, including revenue, expenses, and
profitability metrics. The tool could generate monthly or annual financial reports
and visualize trends over time.

4. Property Listing Website: Develop a platform where landlords can list their
rental properties for prospective tenants to browse and search. The website
could include features such as property search filters, virtual tours, and online
rental applications.

5. Mobile App for Property Inspections: Create a mobile app that allows property
managers to conduct property inspections using their smartphones or tablets.
The app could guide users through inspection checklists, capture photos of
property conditions, and generate inspection reports in real-time.

These applications leverage the database schema and functionality developed in


the project to provide value to landlords, tenants, and property managers in
managing rental properties effectively.

CHAPTER-6
CONCLUSION

The conclusion of the project depends on various factors such as its objectives,
scope, and the outcomes achieved. Here's a generic conclusion for a project
involving the creation of tables, stored procedures, and queries for managing
rental properties:

In conclusion, the project successfully implemented a database schema for


managing rental properties. Key components of the project included the creation
of tables such as categories, houses, payments, system_settings, and tenants,
each designed to store relevant information about the rental properties, tenants,
payments, and system settings.

Additionally, stored procedures insert_payment and process_payments were


developed to facilitate the insertion of payment records and processing of
payments, respectively. These procedures include error handling mechanisms to
ensure data integrity and validity of tenant and category IDs.

Throughout the project, various SQL queries and operations were utilized to
retrieve, filter, aggregate, and manipulate data stored in the database tables.
Examples of these queries include selecting tenant information, calculating
average payments, and performing set operations such as union and intersect.

Overall, the project successfully met its objectives of designing and


implementing a database solution for managing rental properties. It provides a
robust foundation for further development and expansion, with potential future
enhancements including the implementation of additional features such as user
authentication, reporting functionalities, and optimization of database
performance.

Finally, the successful completion of the project underscores the importance of


effective database design and management in facilitating efficient and organized
management of rental properties.
CHAPTER-7
Bibliography

References:

1. MySQL Documentation: https://dev.mysql.com/doc/

2. W3Schools SQL Tutorial: https://www.w3schools.com/sql/

3. Stack Overflow: https://stackoverflow.com/

4. Online SQL Courses and Tutorials:

5. Books on Database Design and SQL:


Books like "Database Systems: The Complete Book" by Hector Garcia-
Molina, Jeffrey D. Ullman, and Jennifer Widom, or "SQL Cookbook"
by Anthony Molinaro can provide comprehensive guidance on
database design principles and SQL techniques.

You might also like