Sample Project - Real Estate

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

1

Real Estate Database

The Real Estate Database goal is to organize information into tables in order to provide

consistent data customer driven and specific to the real estate industry. The primary users of this

database will be real estate agents. The database design is focused on accomplishing the database

goal by selecting specific primary keys and relationships.

Properties Customers Advertisement Lenders Real Estate

Real Estate Properties People selling their of the real estate provides funds for the Agencies
properties properties properties with the
advertise and sell
expectation to be paid in
properties
fees or interest

PropertyID CustomerID AdvertisementID LenderID AgencyID

PropertyType FirstName AdvertisementDate LenderName AgencyName

Size LastName PropertyID Email Zipcode

Year PhoneNumber AgencyID State

Address LenderID

PropertyID

AgencyID

How each table is related to one another:

o Properties to Advertisement (1:M)

o Properties to Customers (1:M)

o Advertisement to Real Estate Agencies (M:1)

o Lenders to Customers (1:M)


o Real Estate Agencies to Customers (1:M)

ERD Lucid Chart Screenshot

Lucid Chart Script

CREATE TABLE [Properties] (


[PropertyID] integer,
[PropertyType] varchar(40),
[Size] integer,
[Year] varchar(4),
[Address] varchar(80),
PRIMARY KEY ([PropertyID])
);

CREATE TABLE [Customers] (


[CustomerID] integer,
[FirstName] varchar(40),
[LastName] varchar(40),
[PhoneNumber] varchar(9),
[LenderID] integer,
[PropertyID] integer,
[AgencyID] integer,
PRIMARY KEY ([CustomerID])
);

CREATE TABLE [Advertisement] (


[AdvertisementID] integer,
[AdvertisementDate] date,
[PropertyID] integer,
[AgencyID] integer,
PRIMARY KEY ([AdvertisementID])
);

CREATE TABLE [Real Estate Agencies] (


[AgencyID] integer,
[AgencyName] varchar(80),
[Zipcode] varchar(5),
PRIMARY KEY ([AgencyID])
);

CREATE TABLE [Lenders] (


[LenderID] integer,
[LenderName] varchar(80),
[Email] varchar(40),
[State] Varchar(2),
PRIMARY KEY ([LenderID])
);
Successful Test using Sqlfiddle.com
Database in SQL Server Management Studio

Script to Add data and Tables:

Table: Advertisement

INSERT INTO Advertisement VALUES ('1101', '01/03/2020', '4401', '2201');


INSERT INTO Advertisement VALUES ('1102', '05/15/2020', '4402', '2202');
INSERT INTO Advertisement VALUES ('1103', '10/10/2020', '4403', '2203');
Table: Customers

INSERT INTO Customers VALUES ('3301', 'Richard', 'Smith', '419208879', '5501', '4401',
'2201');
INSERT INTO Customers VALUES ('3302', 'Samantha', 'Karis', '330208934', '5502', '4402',
'2202');
INSERT INTO Customers VALUES ('3303', 'Timothy', 'Domingo', '600976864', '5503', '4403',
'2203');

Table: Lenders

INSERT INTO Lenders VALUES ('5501', 'Jonathan Wilson', 'jonwilson@gmail.com', 'IN');


INSERT INTO Lenders VALUES ('5502', 'Brittany Stevens', 'stevensbriwork@hotmail.com',
'IL');
INSERT INTO Lenders VALUES ('5503', 'Shannon Vargas', 'vargaslender@gmail.com', 'OH');
Table: Properties

INSERT INTO Properties VALUES ('4401', 'House', '2600', '2006', '16241 S, Farrell Rd,
Lockport, IL 60441');
INSERT INTO Properties VALUES ('4402', 'Appartment', '941', '2012', '1100 5th Ave,
Hammond, IN 46320');
INSERT INTO Properties VALUES ('4403', 'Condo', '1200', '2016', '2333 63rd St, Woodridge,
IL 60517');
Table: Real Estate Agencies

INSERT INTO [Real Estate Agencies] VALUES ('2201', 'RealTopper', '60431');


INSERT INTO [Real Estate Agencies] VALUES ('2202', 'Familia Real Estte Inc.', '50398');
INSERT INTO [Real Estate Agencies] VALUES ('2203', 'R&P Real Estate', '30054');

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy