Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an ER Diagram and then a relational schema based on the following information. Company X operates an online shopping website. The company keeps track

Create an ER Diagram and then a relational schema based on the following information.

Company X operates an online shopping website. The company keeps track of users, user login sessions, shopping carts, inventory items, orders placed by users, order items, shopping carts, order shipments, payments, invoices, suppliers, and components.

The company wants to develop a transaction processing database to store the data of the following business themes:

  • Shopping cart: a unique cart#, active, and expire date
  • Inventory Item (items that are available for sale): a unique inv_item#, title#, price, and date of storing the item in the inventory (Note: inventory items are products for sale).
  • Order (actual orders that are transferred from a shopping cart): a unique order#, order_date, and Total_amount.
  • Order item: a unique order_item# (an order may contain multiple order items. Order_item# is only unique within an order), and quantity
  • User Account: a unique account#, a unique userID, password, account create date, #visits (accumulated number of visits on Company Xs website), #trans (total number of transactions), and ttl_tr_amt (total transaction amount).
  • User session: a unique session#, IPaddress, #clicks (accumulated number of clicks), and timestamp of the session
  • Shipping: a unique shipping#, ship_method, ship_charge, shipping date, and state (shipping state can be pending, processing or shipped)
  • Payment: a unique payment#, amount, state, timestamp
  • Credit card: a unique CC# (this is an auto-generated number), a unique credit card number (this is the 16-digit number of the credit card), holder_name, and expire_date
  • Address: a unique address#, name, and full address (contains add1, add2, city, state, and zip)
  • Invoice: a unique invoice#, and create_date
  • Supplier: a unique supplier#, supplier_name, contact_name, phone number, a unique email address, and address (contains add1, add2, city, state, and zip)
  • Component: a unique component#, and comp_name

The relationships between these business entities are:

  • Each user must have exactly one user account. He/she uses this account to log into the Company Xs website, each login creates a user session. Each user session belongs to exactly one user account, and each user accounts can have one to many user sessions.
  • Each user session may put items in many shopping carts, but it is not necessary to use any shopping cart. Each shopping cart is associated with exactly one user session (note: the relationship between user session and shopping cart is like a user put items in shopping carts. Sometimes a user may use multiple shopping carts in one system login).
  • Each shopping cart can have one to many inventory items, and each inventory item can be placed in many shopping carts but it is not necessary to be in any shopping cart. We want to keep track of the timestamp and the quantity of each cart detail.
  • Each inventory item contains one to many order items, and each order item must belong to exactly one inventory item.
  • Each user account can place many orders, but it is not necessary to place any order. Each order must be placed by exactly one user account.
  • Each order contains one to many order items, and each order item is included in exactly one order.
  • Each order can be shipped in one to multiple shipping, but each shipping belongs to exactly one order.
  • Each shipping has one to many order items, and each order item is shipped once.
  • Each order is paid by exactly one payment, each payment can pay one to many orders.
  • Each payment is charged on exactly one credit card, each credit card can be used to pay many payments but it is not necessary to pay any.
  • Each user can have one to many credit cards, each credit card belongs to exactly one user.
  • Each credit card has exactly one billing address, each billing address can be linked to one to many credit cards.
  • Each shipping is shipped to exactly one address, each address can be associated with multiple shipping, but it is not necessary to be related to any shipping.
  • Each invoice has exactly one address, and each address can be included in one to many invoices.
  • Each shipping has exactly one invoice, and each invoice have one to multiple shipping.
  • Each supplier can provide many components for many inventory items, but they do not have to provide any components for any inventory item.
  • Every component is provided for one to many products by one or many suppliers.
  • Every inventory item contains one or more components, each of which is provide by one or more suppliers.
  • Company X wants to keep track of which suppliers provide which components for which products and the quantity of components in each supply.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions