Skip to content

Instantly share code, notes, and snippets.

@owans
Last active April 2, 2019 21:35
Show Gist options
  • Save owans/86fa1a250852b4f9ca9f28d2b202e6c9 to your computer and use it in GitHub Desktop.
Save owans/86fa1a250852b4f9ca9f28d2b202e6c9 to your computer and use it in GitHub Desktop.
LevelUp Coding Challenge: Design a database for a Logistics Company

Identify Entities

a. Warehousing

b. Shipping

c. Inventory

d. Security

e. Client

f. Customer care service

g. Goods/Product

h. Tracking

Identify data types

  1. Client/Customer: id(INT), first_name(VARCHAR), last_name(VARCHAR), product_id(VARCHAR), tracking_id(VARCHAR), Cost(VARCHAR),phone_number(INT)

  2. Goods: id(INT), product_name(VARCHAR), product_id(VARCHAR), product_type(VARCHAR), tracking_id(VARCHAR)

  3. Warehousing: id(INT), product_id(VARCHAR), product_type(VARCHAR), product_group(VARCHAR)

  4. Inventory: id(INT), product_id(VARCHAR), product_name<VARCHAR), product_type(VARCHAR)

  5. Customer_care: id(INT), staff_first_name(VARCHAR), staf_last_name(VARCHAR), staff_no(VARCHAR), tracking_id(VARCHAR)

  6. Shipping: id(INT), tracking_id(VARCHAR), product_name(VARCHAR), product_id(VARCHAR), delivery_date(Date), Cost(VARCHAR), delivery_method(VARCHAR)

  7. Security: id(INT), first_name(VARCHAR), last_name(VARCHAR), shipping_id(INT), warehousing_id(VARCHAR)

  8. Tracking: id(INT), product_name(VARCHAR), product_id(VARCHAR)

Relationships: 1:1

customer_care to client

tracking_id to goods

client to tracking_id

inventory_id to goods

security to shipping

1:M

shipping to goods

clients to goods

warehousing to goods

security to goods

warehouse to security

security to tracking

customer_care to inventory

M:M

customer_care to goods

customer_care to tracker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment