Inside A Shopping Center Data Model Vertabelo Database Modeler
Inside A Shopping Center Data Model Vertabelo Database Modeler
EXAMPLE ER DIAGRAMS
Tags: database model example data model example ER diagram example ERD diagram
template
:
Shopping centers are fun to visit and complicated to run. In this article, we look
at a data model capable of helping us manage a shopping center.
We shop at shopping centers (also called shopping malls or just malls), but we
also go there to see a movie, eat at a restaurant, or hang out with our friends and
drink coffee. Just about every city or large town has a shopping center. They
provide many different services and we take them for granted. I’d say that my
older readers don’t remember what life was like without the local shopping mall,
and the younger ones can’t even imagine it.
Today, I’ll present a simple model that could run one or more shopping centers.
Let’s start with the business model.
Before we start the data model, we need to answer some questions about
shopping centers:
It is a place where a number of shops are located. The main idea is that
visitors will be more motivated to visit a speciWc location if there is more
than one shop there. They can choose between different types of products,
but they can also look at other things that they weren’t planning to Wnd.
Usually, you’ll Wnd more than just shops in shopping centers. Multiplex
cinemas and café bars are the most famous “additional services” provided
:
in shopping centers. There are often temporary stands, kiosks, or shops,
too. These sell all kind of toys for kids and adults, as well as food and
maybe some services like getting your nails done. Everything in a shopping
mall is geared to entertain visitors, to encourage them to spend a long time
in the mall, and to get them to spend as much money as possible.
Another very old predecessor of the shopping mall is the Grand Bazaar in
Istanbul. It was constructed in the 15th century and still operates today.
With more than 4,000 shops, it’s one of the world’s largest covered markets.
It’s also the #1 tourist attraction on the planet. If you’ll be travelling near
Istanbul, be sure not to miss it.
shop_on_contract
contract id int
id int PK contract_id int
contract_code varchar(8) shop_id int
contract_details text details text
date_signed date
date_active_from date
Contracts
Shopping centers
We’ll describe each subject area in the same order they are listed.
Section 1: Contracts
:
The Contracts subject area contains records for all companies, contracts, and
their related details. We’ll also use this area to store information about the
relationship between shopping center management and the companies that rent
space and also between management and service companies contracted to do
things like cleaning and maintenance.
attribute. It can contain only UNIQUE values. We can expect values like “sold”,
“lease (1 year)” and “lease (5 years)” in this table.
:
The second dictionary in this area is the billing_frequency dictionary. This
stores all values that deWne intervals for generating new invoices. Values stored
in the UNIQUE “name” attribute could include “daily”, “weekly” or “monthly”.
The company table will keep records for all companies (including our own) that
we ever have done business with. We’ll use these values when deWning
companies that signed a contract with us, companies that issued an invoice to
us, and companies we have invoiced. For each company, we’ll store:
Now we’re ready to describe the central table in this subject area: the contract
I’ll start with the shopping_center table. It lists all the shopping centers we own
and/or run. For each shopping center, we’ll store its’ UNIQUE code , name ,
:
address , and all related details .
Within each shopping center, there are one or more shops, restaurants, cafes, or
even cinemas. All of these are stored in the shop table, and for the sake of
convenience, we’ll call them all “shops”. For each one, we’ll store following
information:
The last table in this subject area is the shop_on_contract table. This table
contains a UNIQUE pair ( contract_id – shop_id ) and a description related to
:
each record stored in the details attribute. Notice that many shops can be on
one contract at the same time, but one shop should have only one active
contract at a time. This time period is deWned by the date_active_from and
date_active_to dates in the contract table. When we insert a new record in the
shop_on_contract table, we should check there are no overlapping contracts for
that shop.
The third and last subject area in our model is Invoices and services . This area
contains the three tables needed to store services and invoices related with
contracts. The remaining four tables, which are actually outside this subject area,
are here to show the dependencies between tables.
:
The ideas behind the service and service_on_contract tables are almost exactly
the same as the ones behind the shop and shop_on_contract tables. For each
service, we’ll store its details and a reference to the related contract.
The service table is a simple dictionary where we’ll store the UNIQUE names of
services that are provided to our company. These could be cleaning services,
security services, etc.
All services are related to contracts. They could be one-time services, like repairs
or upgrades; they could also be ongoing, like cleaning services. Both cases will
require contracts with the companies that provide the service. These relations
are stored in the service_on_contract table. The attributes are:
Notice that the contract_id - service_id pair doesn’t only hold UNIQUE values.
We could have many services of the same type on one contract. For example, we
could sign a contract with a cleaning company that provides cleaning services
for Wve shops in our center.
Also, both shopping_center_id and shop_id could contain NULL values. This is
because we could sign a contract for the whole center or for just a few shops.
Therefore, at least one of these attributes should contain NOT NULL values.
The last table in our model is the invoice table. This is where we’ll store all
:
invoices related to customers and contracts. We will assume that invoices are
generated automatically using the date of the previous invoice
( contract . first_invoice_date as the date of the Wrst invoice and the
invoice . date_issued for all invoices afterwards) and the period between two
invoices (deWned with values stored in contract . billing_frequency_id and
contract . billing_units ). The attributes in this table are:
We’ve analyzed a data model that could be used to run one or more shopping
centers. Although this model is not complex, it covers the most commonly
desired functionalities. Can you think of any improvements to this model? Do you
think we should go into more detail? Please tell us!
Tags: database model example data model example ER diagram example ERD diagram
template
Email address
SUBSCRIBE
:
You may also like
Documentation Pricing
FAQ Academy
Support
If you have any questions or you need our help, you can contact us through our
SUPPORT SITE
Follow Us