Question: Online Store Database: Design a relational database schema for an online store that sells products. Include tables for customers, orders, products, and inventory. 1 .
Online Store Database:
Design a relational database schema for an online store that sells products. Include tables for customers, orders, products, and inventory.
Tables
These tables form the foundation for managing bookstorerelated data.
Feel free to adjust the column names, data types, and constraints based on your specific requirements.
Feel free to expand the schema by adding more tables related to inventory, transactions, or other relevant aspects!
Books Table:
Stores information about books available in the store.
Includes columns for book ID title, author ID genre, and ISBN.
CREATE TABLE Books bookid INT PRIMARY KEY, title VARCHAR authorid INT, publisherid INT, price DECIMAL; stockquantity INT
Authors Table:
Contains details about authors.
Columns include author ID first name, last name, and birth year.
CREATE TABLE Authors authorid INT PRIMARY KEY, ; authorname VARCHAR
Publishers Table:
Stores information about book publishers.
Columns include publisher ID publisher name, and location.
CREATE TABLE Publishers publisherid INT PRIMARY KEY, publishername VARCHAR location VARCHAR
;
CIS W
Team Project Suggested Projects
Page of
Customers Table:
Records customer details.
Includes columns for customer ID first name, last name, email, and phone number.
CREATE TABLE Customers
customerid INT PRIMARY KEY,
firstname VARCHAR
lastname VARCHAR
email VARCHAR
phonenumber VARCHAR
address VARCHAR
;
Orders Table:
Tracks customer orders.
Columns include order ID customer ID order date, and total amount.
CREATE TABLE orders orderid INT PRIMARY KEY, customerid INT, orderdate DATE, totalamount DECIMAL
;
FOREIN KEY customerid REFERENCES customerscustomerid
Requirements
Implement CRUD Create Read, Update, Delete operations for managing customer data, product details, and order history.
Create complex queries to retrieve information such as topselling products, customer order summaries, and inventory levels.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
