0% found this document useful (0 votes)
99 views4 pages

Cart

The document describes tables and relationships in an e-commerce database schema. There are tables for products, cart items, sessions, users, orders, order items, and payments. The tables are related through foreign keys. For example, cart items link to products and sessions, and orders link to users, payments and order items. The schema can be analyzed to gain business insights like best selling products, top customers, and inventory management. Some improvements are suggested such as adding order status and payment status fields.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views4 pages

Cart

The document describes tables and relationships in an e-commerce database schema. There are tables for products, cart items, sessions, users, orders, order items, and payments. The tables are related through foreign keys. For example, cart items link to products and sessions, and orders link to users, payments and order items. The schema can be analyzed to gain business insights like best selling products, top customers, and inventory management. Some improvements are suggested such as adding order status and payment status fields.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Cart_item: Modified_at Created_at

Cart_Id payment_details: Modified_at

Session_id Payment_id

Product_id Order_id Session:

Quantity Amount Session_id

Created_at Status User_id total

Modified_at Created_at Created_at

Modified_at Modified_at

order_details:

Order_id Product: Users:

User_id total Product_id User_id

Payment_id Product_Name Users_Name

Created_at Product_Image First_name

Modified_at Description Middle_name

SKU Last_name

order_items: Category User_gmail

Item_id Order_id Price Users_password

Product_id Available_Units Phone

Created_at Sold_Units Address

Status

Created_at

Modified_at

1. Cart_Item and Product:


- Relationship: `Cart_Item` has a foreign key `Product_id` that references the primary key `Product_id`
in the `Product` table. This indicates a relationship between items added to a cart and the specific
products available.

2. Cart_Item and Session:

- Relationship: `Cart_Item` has a foreign key `Session_id` that references the primary key `Session_id`
in the `Session` table. This implies that cart items are associated with a specific session, likely indicating
items added to a cart during a user session.

3. Order_Details and Users:

- Relationship: `Order_Details` has a foreign key `User_id` that references the primary key `User_id` in
the `Users` table. This indicates that order details are associated with a particular user who placed the
order.

4.Order_Details and Payment_Details:

- Relationship: `Order_Details` has a foreign key `Payment_id` that references the primary key
`Payment_id` in the `Payment_Details` table. This connection suggests that order details are linked to
specific payment information for that order.

5. Order_Items and Order_Details:

- Relationship: `Order_Items` has a foreign key `Order_id` that references the primary key `Order_id` in
the `Order_Details` table. This indicates that order items are associated with a specific order.

6. Payment_Details and Order_Details:

- Relationship: `Payment_Details` has a foreign key `Order_id` that references the primary key
`Order_id` in the `Order_Details` table. This suggests that payment details are linked to specific orders.

7. Product and Order_Items:

- Relationship: `Product` has a primary key `Product_id` which is referenced as a foreign key
`Product_id` in the `Order_Items` table. This relationship signifies that products are associated with
items within orders.

8. Session andUsers:
- Relationship: `Session` has a foreign key `User_id` that references the primary key `User_id` in the
`Users` table. This suggests that sessions are related to specific users.

1. Product Table: Contains details about the available products, such as product name, image,
description, SKU (Stock Keeping Unit), category, price, available units, sold units, and timestamps for
creation and modification. It stores all the product-related information necessary for displaying items in
the store.

2. Cart_Item Table: Manages items added to a user's cart during a session. It records the products added,
their quantity, and timestamps for creation and modification. This table is vital for handling the shopping
cart functionality.

3. Session Table: Tracks user sessions and associates them with specific users. It helps in maintaining user
activity during their visit to the online store, including their cart items and timestamps for creation and
modification.

4. Users Table: Stores user information like name, email, password, contact details, address, status, and
timestamps for creation and modification. It keeps track of registered users who can make purchases and
interact with the online store.

5. Order_Details and Order_Items Tables: These tables are crucial for managing orders. Order_Details
contains information about orders, such as the user who placed the order, total amount, timestamps,
and more. Order_Items details the items within each order, linking to the products and orders they
belong to, along with timestamps for creation and modification.

6. Payment_Details Table: Manages payment-related information, including the amount, status,


timestamps, and the order to which the payment corresponds.

Analyzing Data for Store Operations:

Best Selling Products:

To find the best-selling products, you can use queries that aggregate data from the `Order_Items` table
and sum the quantities sold for each product. By grouping by `Product_id` and summing `Quantity` for
each product, you can identify the products with the highest total quantity sold.
Most Active Users/Transactions:

To identify the most active users or those with the highest transaction count, you can query the `Users`
table and join it with the `Order_Details` table using the `User_id`. Grouping by `User_id` and counting
the number of transactions/orders made by each user will help find the most active users.

Other Store Operational Insights:

- Revenue Generation: Calculate total revenue by summing up the `Amount` from `Payment_Details`.

- Inventory Management: Track available units in the `Product` table and deduct sold units from available
units to manage inventory.

- User Behavior Analysis: Analyze session data in the `Session` table to understand user behavior, like
session duration, frequently viewed products, etc.

What should be changed?

Cart item gone

Product sold > fulfilled orders

Status of order on order details <Fulfilled, Partial>

Sold units should be on order details

Payment status on Payment details <Full , partial, unpaid>

Total amount on payment details

Paid amount on payment details

You might also like