Tables in this data model
- agencies — 3 columns
- agents — 4 columns
- properties — 7 columns
- listings — 7 columns
- listing_photos — 4 columns
- buyers — 3 columns
- viewings — 4 columns
- offers — 5 columns
- saved_searches — 4 columns
How to use this ER diagram template
- Click Open in the editor. The ER diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
- Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
- Drop in vendor logos from the library — 1,160 of them, including every AWS, Azure and Google Cloud service icon — or restyle it with the colour and theme controls.
- Prefer text? Edit the DBML below and paste it in through ☰ → Import diagram; the finished model exports to SQL DDL or back to DBML.
- Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.
DBML source
The whole template is the text below. Paste it into FlowDiagram, keep it in Git next to the code it describes, or hand it to an AI assistant to extend.
Table agencies {
id integer [pk]
name varchar
licence_no varchar
}
Table agents {
id integer [pk]
agency_id integer [ref: > agencies.id]
name varchar
phone varchar
}
Table properties {
id integer [pk]
address varchar
bedrooms integer
bathrooms integer
floor_area_m2 integer
lat decimal
lng decimal
}
Table listings {
id integer [pk]
property_id integer [ref: > properties.id]
agent_id integer [ref: > agents.id]
kind varchar
price decimal
status varchar
listed_on date
}
Table listing_photos {
id integer [pk]
listing_id integer [ref: > listings.id]
url varchar
position integer
}
Table buyers {
id integer [pk]
name varchar
email varchar
}
Table viewings {
id integer [pk]
listing_id integer [ref: > listings.id]
buyer_id integer [ref: > buyers.id]
scheduled_at timestamp
}
Table offers {
id integer [pk]
listing_id integer [ref: > listings.id]
buyer_id integer [ref: > buyers.id]
amount decimal
status varchar
}
Table saved_searches {
id integer [pk]
buyer_id integer [ref: > buyers.id]
criteria varchar
alert_frequency varchar
}
Related: Database schema diagram tool · All database & er models templates · All 521 templates