TGViewer
SQL Programming Resources SQL Programming Resources @sqlanalyst ยท 76.7K subscribers
Post #2636 2.41K
๐Ÿš€ SQL Project Series #24

Real Estate Property Analytics ๐Ÿ 

Analyze properties, buyers, agents, sales, and rentals using SQL to understand market trends, optimize pricing, and improve business performance.

๐ŸŽฏ Business Objectives
โœ… Analyze property sales
โœ… Monitor rental performance
โœ… Evaluate agent performance
โœ… Track customer preferences
โœ… Analyze property prices
โœ… Measure market trends
โœ… Identify high-demand locations
โœ… Build executive dashboards

๐Ÿ“‚ Step 1: Create Database

CREATE DATABASE real_estate_db;
USE real_estate_db;


๐Ÿ“‚ Step 2: Create Agents Table

CREATE TABLE agents (
agent_id INT PRIMARY KEY,
agent_name VARCHAR(100),
city VARCHAR(50),
experience_years INT
);


๐Ÿ“‚ Step 3: Create Customers Table

CREATE TABLE customers (
customer_id INT PRIMARY KEY,
customer_name VARCHAR(100),
city VARCHAR(50),
customer_type VARCHAR(20)
);


๐Ÿ“‚ Step 4: Create Properties Table

CREATE TABLE properties (
property_id INT PRIMARY KEY,
property_type VARCHAR(50),
city VARCHAR(50),
bedrooms INT,
listing_price DECIMAL(12,2),
listing_date DATE,
agent_id INT,
FOREIGN KEY (agent_id)
REFERENCES agents(agent_id)
);


๐Ÿ“‚ Step 5: Create Transactions Table

CREATE TABLE transactions (
transaction_id INT PRIMARY KEY,
property_id INT,
customer_id INT,
transaction_type VARCHAR(20),
transaction_date DATE,
sale_price DECIMAL(12,2),
FOREIGN KEY (property_id)
REFERENCES properties(property_id),
FOREIGN KEY (customer_id)
REFERENCES customers(customer_id)
);


๐Ÿ“‚ Step 6: Insert Sample Agents

INSERT INTO agents VALUES
(101,'Amit Sharma','Mumbai',8),
(102,'Priya Singh','Delhi',6),
(103,'Rahul Mehta','Pune',10),
(104,'Sneha Patel','Bangalore',5);


๐Ÿ“‚ Step 7: Insert Sample Customers

INSERT INTO customers VALUES
(1,'Rahul Verma','Mumbai','Buyer'),
(2,'Anjali Gupta','Delhi','Tenant'),
(3,'Rohan Patel','Pune','Buyer'),
(4,'Neha Sharma','Bangalore','Tenant'),
(5,'Aakash Shah','Hyderabad','Buyer');


๐Ÿ“‚ Step 8: Insert Sample Properties

INSERT INTO properties VALUES
(1001,'Apartment','Mumbai',2,8500000,'2025-01-05',101),
(1002,'Villa','Delhi',4,22000000,'2025-01-08',102),
(1003,'Apartment','Pune',3,9500000,'2025-01-12',103),
(1004,'Studio','Bangalore',1,4200000,'2025-01-15',104),
(1005,'Villa','Hyderabad',5,28000000,'2025-01-18',103);


๐Ÿ“‚ Step 9: Insert Sample Transactions

INSERT INTO transactions VALUES
(5001,1001,1,'Sale','2025-02-01',8300000),
(5002,1002,2,'Rent','2025-02-03',45000),
(5003,1003,3,'Sale','2025-02-05',9200000),
(5004,1004,4,'Rent','2025-02-08',28000),
(5005,1005,5,'Sale','2025-02-12',27500000);


๐Ÿง  SQL Concepts You'll Practice
โœ” DDL & DML
โœ” INNER JOIN
โœ” LEFT JOIN
โœ” Aggregate Functions
โœ” GROUP BY
โœ” HAVING
โœ” CASE WHEN
โœ” Date Functions
โœ” CTEs
โœ” Window Functions
โœ” Ranking Functions

๐Ÿ“Š Business KPIs You Can Build
๐Ÿ“ˆ Total Properties Listed
๐Ÿ“ˆ Total Properties Sold
๐Ÿ“ˆ Total Rental Properties
๐Ÿ“ˆ Total Sales Revenue
๐Ÿ“ˆ Average Property Price
๐Ÿ“ˆ Average Rent
๐Ÿ“ˆ Revenue by City
๐Ÿ“ˆ Revenue by Property Type
๐Ÿ“ˆ Top Performing Agents
๐Ÿ“ˆ Agent-wise Sales
๐Ÿ“ˆ Average Selling Time
๐Ÿ“ˆ Property Listing Trend
๐Ÿ“ˆ Monthly Sales Trend
๐Ÿ“ˆ Most Expensive Property Sold
๐Ÿ“ˆ Cheapest Property Sold
๐Ÿ“ˆ Property Demand by City
๐Ÿ“ˆ Buyer vs Tenant Ratio
๐Ÿ“ˆ Average Bedrooms Sold
๐Ÿ“ˆ Conversion Rate (Listed to Sold)
๐Ÿ“ˆ Executive Real Estate Dashboard

๐ŸŽฏ This project reflects real-world SQL analysis performed by Real Estate Analysts, Property Management teams, Sales Analysts, and Business Intelligence professionals to optimize pricing, monitor sales performance, and identify market trends.

Double Tap โค๏ธ For More
  • โค 12
More from @sqlanalyst
  1. Oct 8, 2026๐ŸŽ“ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€! ๐Ÿš€๐Ÿ”ฅ Upgrโ€ฆ
  2. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  3. Oct 7, 2026SQL Interview Series โ€” Part 4 ๐Ÿ“Œ Question 4: Find the Highest Salary in Each Department Suโ€ฆ
  4. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
  5. Sep 29, 2026SQL Interview Series โ€” Part 2 ๐Ÿ“Œ Question 2: Find Duplicate Records Suppose you have an Emโ€ฆ
  6. Sep 29, 2026๐—™๐—ฅ๐—˜๐—˜ ๐—ฅ๐—ฒ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ๐˜€ ๐—ง๐—ผ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป ๐—”๐—œ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ๐Ÿš€ โ€‹ Explore 6 free resourceโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’