Real Estate Property Management Database Design

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Real Estate Property Management System Database Design

Scenario

A real estate company manages various properties for rental. Each property has specific details like

location, type, and rental price. Properties are leased to tenants, who have information like name,

contact details, and lease details. The company records payments from tenants, manages

maintenance tasks for each property, and tracks the status of each lease.

Requirements

1. Property Management:

- Store details for each property (Property ID, Address, Type, Rent Amount, and Status).

- Track which properties are currently leased and which are available.

2. Tenant Management:

- Maintain tenant information (Tenant ID, Name, Contact Number, and Address).

- Link tenants to the properties they lease, with start and end dates for each lease.

3. Lease Management:

- Store lease information, including the lease ID, property ID, tenant ID, lease start date, and lease

end date.

- Track the status of each lease (active, pending, or completed).

4. Payment Management:

- Record payments made by tenants with details like amount, date, and lease ID.

- Link payments to the corresponding lease for accurate tracking.


5. Maintenance Management:

- Track maintenance requests and tasks with property ID, task description, and status.

Enhanced Entity-Relationship Diagram (EERD)

Entities and Attributes:

1. Property: Property_ID (PK), Address, Type, Rent_Amount, Status.

2. Tenant: Tenant_ID (PK), Name, Contact_Number, Address.

3. Lease: Lease_ID (PK), Property_ID (FK), Tenant_ID (FK), Start_Date, End_Date, Status.

4. Payment: Payment_ID (PK), Lease_ID (FK), Amount, Payment_Date.

5. Maintenance: Maintenance_ID (PK), Property_ID (FK), Task_Description, Status.

Relationships and Cardinalities

1. Property to Lease: A property can have multiple leases over time (1-to-many).

2. Tenant to Lease: A tenant can have multiple leases over time, but each lease is linked to one

tenant (1-to-many).

3. Lease to Payment: A lease can have multiple payments (1-to-many).

4. Property to Maintenance: A property can have multiple maintenance requests (1-to-many).

Specialization and Generalization

Specialization: For the Property entity, specialization can be applied to differentiate property types

(Apartment, House, Commercial) with unique attributes for each.

Generalization: A Person entity could generalize both tenants and property owners if needed.

SQL Code for Database Schema

-- Database: Real Estate Property Management


CREATE TABLE Property (

Property_ID INT PRIMARY KEY AUTO_INCREMENT,

Address VARCHAR(255) NOT NULL,

Type ENUM('Apartment', 'House', 'Commercial') NOT NULL,

Rent_Amount DECIMAL(10, 2) NOT NULL,

Status ENUM('Available', 'Leased') DEFAULT 'Available'

);

CREATE TABLE Tenant (

Tenant_ID INT PRIMARY KEY AUTO_INCREMENT,

Name VARCHAR(255) NOT NULL,

Contact_Number VARCHAR(15),

Address TEXT

);

CREATE TABLE Lease (

Lease_ID INT PRIMARY KEY AUTO_INCREMENT,

Property_ID INT,

Tenant_ID INT,

Start_Date DATE NOT NULL,

End_Date DATE NOT NULL,

Status ENUM('Active', 'Pending', 'Completed') DEFAULT 'Pending',

FOREIGN KEY (Property_ID) REFERENCES Property(Property_ID),

FOREIGN KEY (Tenant_ID) REFERENCES Tenant(Tenant_ID)

);
CREATE TABLE Payment (

Payment_ID INT PRIMARY KEY AUTO_INCREMENT,

Lease_ID INT,

Amount DECIMAL(10, 2) NOT NULL,

Payment_Date DATE NOT NULL,

FOREIGN KEY (Lease_ID) REFERENCES Lease(Lease_ID)

);

CREATE TABLE Maintenance (

Maintenance_ID INT PRIMARY KEY AUTO_INCREMENT,

Property_ID INT,

Task_Description TEXT NOT NULL,

Status ENUM('Pending', 'Completed') DEFAULT 'Pending',

FOREIGN KEY (Property_ID) REFERENCES Property(Property_ID)

);

You might also like