Challenge

Project 1

The "Customers" table is represented by a rectangle with the following fields:

  • _id (primary key)
  • name
  • email
  • password
  • type
  • personal_info

The "Sellers" table is represented by a rectangle with the following fields:

  • _id (primary key)
  • name
  • email
  • password
  • personal_info

The "Categories" table is represented by a rectangle with the following fields:

  • _id (primary key)
  • name
  • parent (foreign key to Categories._id)

The "Brands" table is represented by a rectangle with the following fields:

  • _id (primary key)
  • name

The "Segments" table is represented by a rectangle with the following fields:

  • _id (primary key)
  • name

The "Tags" table is represented by a rectangle with the following fields:

  • _id (primary key)
  • name

The "Products" table is represented by a rectangle with the following fields:

  • _id (primary key)
  • name
  • price
  • description
  • images
  • categories (foreign key to Categories._id)
  • brands (foreign key to Brands._id)
  • segments (foreign key to Segments._id)
  • tags (foreign key to Tags._id)

The "Carts" table is represented by a rectangle with the following fields:

  • _id (primary key)
  • customer_id (foreign key to Customers._id)
  • products
  • total

The "Orders" table is represented by a rectangle with the following fields:

  • _id (primary key)
  • customer_id (foreign key to Customers._id)
  • seller_id (foreign key to Sellers._id)
  • products
  • shipping_details
  • billing_info
  • status
The relationships between the tables are as follows:

The "Customers" table has a one-to-many relationship with the "Carts" table, as one customer can have multiple carts, but each cart belongs to only one customer.
 
The "Customers" table has a one-to-many relationship with the "Orders" table, as one customer can place multiple orders, but each order belongs to only one customer.
 
The "Sellers" table has a one-to-many relationship with the "Orders" table, as one seller can receive multiple orders, but each order is placed with only one seller.
 
The "Categories" table has a one-to-many relationship with the "Categories" table, as one category can have multiple subcategories, but each subcategory belongs to only one parent category.
 
The "Products" table has a many-to-many relationship with the "Categories" table, as one product can belong to multiple categories and one category can have multiple products.
 
The "Products" table has a many-to-one relationship with the "Brands" table, as one product can belong to only one brand, but one brand can have multiple products.
 
The "Products" table has a many-to-one relationship with the "Segments" table, as one product can belong to only one segment, but one segment can have multiple products.
 
The "Products" table has a many-to-many relationship with the "Tags" table, as one product can have multiple tags and one tag can be associated with multiple products.
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.