UNIVERSITY OF THE PEOPLE (UoPeople)
CS 2203-01 - Databases 1
Lutalo Martin
BSc. Computer Science
CS 2203-01 - AY2025-T4 / Programming Assignment Unit 2
Instructor Baraka Laiza
24th April 2025
Database design for an e-commerce company
1. Concept of a conceptual data model
A conceptual data model is a high-level schema of a database system that outlines what
data needs to be stored-not how it will be stored. The conceptual model identifies the
central entities for a business domain, along with their attributes and relationships,
without technical implementation details. This model is beneficial in describing how data
about products, customers, orders, and inventory are related to perform business
transactions for an e-commerce company. As described by Nalimov (2021), conceptual
data models provide a visual representation and organized description of business entities
and their interrelationships.
2. Entity definitions and relationships
Entities and Attributes:
Product:
ProductID (Primary Key)
ProductName
Description
Price
Category
Customer:
CustomerID (Primary Key)
FirstName
LastName
Email
Phone
Address
Order:
OrderID (Primary Key)
OrderDate
TotalAmount
CustomerID (Foreign Key referencing Customer)
Inventory:
InventoryID (Primary Key)
ProductID (Foreign Key referencing Product)
QuantityInStock
WarehouseLocation
Relationships:
A Customer can place multiple Orders (One-to-Many).
An Order can include multiple Products, and each Product can appear in multiple
Orders (Many-to-Many, resolved via OrderDetails table).
Inventory tracks the stock level of Products (One-to-One or One-to-Many depending
on structure).
3. Logical and physical table design
Logical tables:
Customer (CustomerID PK, FirstName, LastName, Email, Phone, Address)
Product (ProductID PK, ProductName, Description, Price, Category)
Order (OrderID PK, OrderDate, TotalAmount, CustomerID FK)
OrderDetails (OrderDetailID PK, OrderID FK, ProductID FK, Quantity, SubTotal)
Inventory (InventoryID PK, ProductID FK, QuantityInStock, WarehouseLocation)
4. Entity-Relationship (ER) diagram
To visually represent the relationships and constraints:
Entities:
Each entity will be a box labeled with attributes.
Relationships:
Lines will connect entities, showing cardinality (e.g., one-to-many relationships
between Customer and Order or Product and Inventory).
Participation constraints will indicate required or optional relationships.
The ER diagram illustrates the key components of the database, including entities,
attributes, keys, and relationships. It indicates the following:
Entities: Product, Customer, Order, Inventory, and OrderDetails
Relationships:
Customer places Order (1:N)
Order includes Product (M:N through OrderDetails)
Product has Inventory (1:N or 1:1)
Cardinality and Participation:
One customer can place many orders (total participation from Order).
Orders must contain at least one product (mandatory participation).
A product may or may not be in stock (optional participation from Inventory).
6. ER diagram code
Table Product {
ProductID int [pk, increment]
ProductName varchar
Description text
Price decimal
Category varchar
Table Customer {
CustomerID int [pk, increment]
FirstName varchar
LastName varchar
Email varchar
Phone varchar
Address text
Table "Order" {
OrderID int [pk, increment]
OrderDate datetime
TotalAmount decimal
CustomerID int [ref: > Customer.CustomerID]
Table OrderDetails {
OrderDetailID int [pk, increment]
OrderID int [ref: > Order.OrderID]
ProductID int [ref: > Product.ProductID]
Quantity int
SubTotal decimal
Table Inventory {
InventoryID int [pk, increment]
ProductID int [ref: > Product.ProductID]
QuantityInStock int
WarehouseLocation varchar
Differences Between Conceptual and Physical Design
1. Conceptual Design:
Purpose: Conceptual Design focuses on the logical structure of the
database, including entities, attributes, and relationships. It answers what
the data represents and how it should interact within the system.
Role: In this scenario, it helps visualize how Product, Customer, Order,
and Inventory interact, allowing stakeholders to understand database
structure.
Output: Entity-Relationship diagrams showing logical connections.
2. Physical Design:
Purpose: Physical Design deals with the technical implementation,
specifying how the data is stored, retrieved, and optimized for
performance. It answers how the data operates on a physical server or
platform.
Role: Defines how the e-commerce database will be physically stored and
queried, ensuring data integrity and optimization.
Output: Structured tables with primary and foreign keys, storage
specifications.
The database system achieves operational efficiency for administrators and clarity for
stakeholders by taking into account both conceptual and physical design.
References
Elmasri, R., & Navathe, S. B. (2016). Database systems: Design, implementation, &
management (13th ed.). Pearson. ISBN 978-0-13-397077-7.
Vidhya, V., Jeyaram, G., & Ishwarya, K. (2016). *Database management systems*.
Alpha Science International. https://www.auhd.edu.ye/upfiles/elibrary/Azal2020-
01-22-12-28-11-76901.pdf
Groves, M. (2025, April 24). Data modeling explained: conceptual, physical, logical.
The Couchbase Blog. https://www.couchbase.com/blog/conceptual-physical-
logical-data-models/
Nalimov, C. (2021, September 22). What is a conceptual data model? With examples!
https://www.gleek.io/blog/conceptual-data-model.html
Ellie. (2022, July 6). Conceptual vs Logical Data Models - What are the key differences?
[Video]. YouTube. https://www.youtube.com/watch?v=Ex6wszg2XZ8