You are on page 1of 1

YONKI REAL STATE AGENCY

- * = relationship
between mother table
and daughter tables
(foreign key)
YONKI REAL
STATE
*flats* : flat_id Every person has an ID
related to a name and
*persons* : phone number, later this
person_id persons are divided in
different categories where
FLATS PERSONS they get another ID
besides their person_id to
flat_id : int (pk) person_id : int (pk) be sorted in different
tables.
adress : varchar(45) name : varchar(45)
area : int phone_number :
string
num_rooms : int
References
price : large int
Characteristics the towns
table *town* : town_id the flats
references a are
flat ID in *zone* : zone_id located at CUSTOMERS OWNERS AGENTS
order to *characteristics*
attach the *person* : person_id *person* : person_id *person* : person_id
properties of *owner* : owner_id
customer_id : int (pk) owner_id : int (pk) agent_id : int (pk)
each flat to
it's primary NIF : string adress : varchar(45) ss_number : string
key.
adress : varchar (45) NIF : string salary : int
*owned_flat/s* : adress : varchar (45)
flat_id : int
CHARACTERISTICS TOWN

elevator : bool town_id : int (pk)


ASSIGNEMENTS
terrace : bool inhabitants_num :
large int *agent_id* : int (pk)
air_conditioner : bool CLIENT
*zones* : zone_id INTERESTS *client_assigned* :
appliances : bool *customer_interested* customer_id : int
*flats_in_town* : : customer_id : int
*flat_id : int* (pk) flat_id (pk)
*flats_interested_in*
: flat_id : int
References *zone_lookin_into* :
the zone zone_id : int
ZONES
the town is
in. zone_id : int (pk)
adjacent_zones : int
town_name :
varchar(45)
*town* : town_id

VISITS

visit_id : int (pk)


*client_visiting* : customer_id : int { no visits to be scheduled
at the same
*agent_assigned* : agent_id : int *date_of_visit* }
*flat_visited* : flat_id : int
date_of_visit : datetime

You might also like