0% found this document useful (0 votes)
13 views1 page

DB Schema

The document describes the database schema for an online bookstore. It includes tables for users, user profiles, books, publishers, authors, categories, orders, wishlists and more. Relationships between the tables are defined through foreign keys.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

DB Schema

The document describes the database schema for an online bookstore. It includes tables for users, user profiles, books, publishers, authors, categories, orders, wishlists and more. Relationships between the tables are defined through foreign keys.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

user

id INT

username VARCHAR(50)
email VARCHAR(100)
password VARCHAR(255)
role ENUM(...)
created_at TIMESTAMP
Indexes

user_profile
book_promotion
user_id INT
book_id INT
full_name VARCHAR(100)
promotion_id INT
address VARCHAR(200)
Indexes promotion
phone VARCHAR(20)
id INT
Indexes
code VARCHAR(20)
discount_percentage DECIMAL(5,2)

start_date DATE
end_date DATE

order Indexes

id INT wishlist
user_id INT user_id INT
status ENUM(...) book_id INT
created_at TIMESTAMP Indexes

updated_at TIMESTAMP

shipping_address VARCHAR(200)
billing_address VARCHAR(200)
order_item
total_amount DECIMAL(10,2) book_author
id INT
Indexes book_id INT
order_id INT
author_id INT
book_id INT
Indexes author
quantity INT book
id INT
price DECIMAL(8,2) id INT
Indexes name VARCHAR(100)
title VARCHAR(100)
Indexes
isbn CHAR(13)
publisher_id INT
publication_date DATE

language VARCHAR(20) category


pages INT id INT
publisher description TEXT name VARCHAR(50)
id INT price DECIMAL(8,2) parent_id INT
name VARCHAR(100) image_url VARCHAR(255)
book_category Indexes
Indexes Indexes
book_id INT
category_id INT
Indexes

inventory
book_id INT

stock_quantity INT
Indexes

You might also like