You are on page 1of 4

For this assignment, you will need to think about what data is vital to your business.

Then, think
about how that data would be organized to support your business. It would help to think about
how this data would be connected if you were going to build a system for your business. (hint:
this is the first step to systems development and design, but we’re not going to build it; purely
conceptual)

An example might be helpful. So, let's say I wanted to open an online pet store. My first step is
to think about my customers, products, services etc. What would I want to record and track
about them? Some of the data that might be important to my business: customer data, pet
data, product information, purchases, payment details. These are the entities and would be
represented as tables in my diagram.

CUSTOMERS PETS PRODUCTS PAYMENT PURCHASES

Next, think about what the data in each table would look like. What would I need to know about
each? For example, in my “CUSTOMERS” table, I may want to know their name, phone, email,
street address, zip code, state, country, etc. These are called attributes. For the “PETS” table, I
could record pet name, type of animal, specific breed, fur color, etc. See the remaining
examples below:

CUSTOMERS PETS PRODUCTS PAYMENT PURCHASES


Name Pet Name Product Type Credit Card # Confirmation #
Phone # Age Description Name On Card Total
Email Type Price Brand Order Date
Street Breed Warehouse Exp. Date Shipping Date
Zip Fur Color Weight Security Code Tracking #
State Weight
Country

Most of the work is done already. Now, I need to decide how these tables connect. My
“CUSTOMERS” should be connected to my “PETS” to able to track all the pets that belong to
which owners and vice versa. I also want to track every purchase my customer makes; I connect
“PURCHASES” to “CUSTOMER”. I also connect “PURCHASES” to “PRODUCTS” so I can track all
the items in each purchase. I will also want to know what payment method was used in each
purchase; connect “PURCHASES” to “PAYMENT”. While not necessary, I have decided to connect
my “PETS” table to “PURCHASES” in the event I would like to track purchases not just by
customers but by each specific pet.

PETS PURCHASES
Pet Name Confirmation #
Age CUSTOMERS Total
Type Name Order Date
Breed Phone # Shipping Date
Fur Color Email Tracking #
s Weight Street
Zip
State
Country

PRODUCTS PAYMENT
Product Type Credit Card #
Description Name On Card
Price Brand
Warehouse Exp. Date
Weight Security Code

Lastly, I need to identify primary keys. A primary key is a field in a table which uniquely identifies
each row/record in a database table. Primary keys must contain unique values. Primary keys are
important to prevent duplicates in our records. What if I had customers with the name exact
name? What if they moved and I tracked them by address? What if I had similar products? How
could I uniquely identify them? I highlighted my primary keys below in red.
PETS PURCHASES
Pet ID Confirmation #
Pet Name CUSTOMERS Total
Age Customer ID Order Date
Type Name Shipping Date
Breed Phone # Tracking #
s Fur Color Email
Weight Street
Zip
State
Country

PRODUCTS PAYMENT
Product ID Credit Card #
Product Type Name On Card
Description Brand
Price Exp. Date
Warehouse Security Code
Weight

I have completed my basic ERD!

Bonus:
This is an optional step but since we’re learning, I want to also introduce to you the concept of
“foreign keys”. A foreign key is a field (or collection of fields) in one table, that refers to the
primary key in another table, to create a way of cross-referencing the two tables. For every
table you connect, there must be a way to tie the tables together to track the data. For example:
if I wanted to find to track what items were in a purchase, I would list the product ID in the
“PURCHASES” table. Product ID is the primary key for the “PRODUCTS” table but is also a foreign
key in the “PURCHASES” table. I would repeat this if I also wanted to track which payment was
used per purchase, which customer completed the purchase, and which pet the purchase was
for. I have one last connection between the “PETS” table and “CUSTOMERS”. To complete this, I
can add the Customer ID to the “PETS” table. See the foreign keys highlighted in green below.
PETS PURCHASES
Pet ID Confirmation #
Pet Name CUSTOMERS Total
Age Customer ID Order Date
Type Name Shipping Date
Breed Phone # Tracking #
s Fur Color Product ID
Email
Weight Street Credit Card #
Customer ID Zip Customer ID
State Pet ID
Country

PRODUCTS PAYMENT
Product ID Credit Card #
Product Type Name On Card
Description Brand
Price Exp. Date
Warehouse Security Code
Weight

You might also like