webnovel

Simple online bookstore database design

2024-09-23 00:15
Not many requirements. User ID, account password, ID, title, author, etc. in the table. How do I save which user bought which book? Should I add a username to the library and build a relationship diagram? Or was he going to build a table to save it? I just don't understand how to make sure that the book A buys is the book A buys, and not all users buy it. How do I design this relationship diagram? There's no need to classify the books or anything.
2024-09-23 01:08

The database design of the online bookstore should include the following components: 1. Item Information Table (Item) -Store the basic information of the item such as title, author, price, description, classification, etc. 2. Order Information Table ( Order) -Store the order information of the customer, including the order number, customer name, order status, order items, etc. 3. Stock-Storage of stock information, including item number, stock quantity, purchase date, supplier, etc. 4. Order Management-used to record all orders created, modified, deleted, and the status of the order (completed, in progress, not processed, etc.). 5. Customer Information Form-used to record the basic information of the customer, such as name, email address, telephone number, etc. 6. The payment information table-used to record all payment methods such as credit card, AliPay, Weixin Pay, etc. 7. The supplier information sheet-used to record the basic information of the supplier, such as company name, address, contact information, etc. The following is a simple online bookstore database design example. The product information table, order information table, and inventory information table already include some basic data fields: ``` --Item Information Form (Product) CREATE TABLE Product ( Product_ID INT PRIMARY KEY Product_Name VARCHAR(50) NOT NULL Product_Price DECIMAL(10 2) NOT NULL Product_Description TEXT NOT NULL Product_category VARCHAR(20) NOT NULL FOREIGN KEY (Product_ID) REFERENCES Product(ID) ); --Order Information Form (Order) CREATE TABLE Order ( Order_ID INT PRIMARY KEY Customer_Name VARCHAR(50) NOT NULL Order_Status VARCHAR(20) NOT NULL Order_Product VARCHAR(50) NOT NULL Order_Time TIMESTAMP NOT NULL FOREIGN KEY (Order_ID) REFERENCES Order(ID) ); --Storage Information Form (Stock) CREATE TABLE Stock ( Stock_ID INT PRIMARY KEY _ Arrival_Date Date NOT Empty <strong></strong><strong></strong> FOREIGN KEY (Stock_ID) REFERENCES Stock(ID) ); --Order Management CREATE TABLE Order Management ( Order_ID INT NOT NULL Order_'s status VarCHAR(20) NOT nil Order_'s method VARCHAR(20) NOT nil FOREIGN KEY (Order_ID) REFERENCES Order(ID) ); --Customer Information Form CREATE TABLE Customer ( Customer_ID INT NOT NULL Customer_Name VARCHAR(50) NOT NULL Customer_Email VARCHAR(100) NOT NULL Customer_Phone VARCHAR(20) NOT NULL FOREIGN KEY (Customer_ID) REFERENCES Customer(ID) ); --payment information form (Payment) CREATE TABLE Payment ( Payment_ID INT NOT NULL Payment_Name VARCHAR(50) NOT NULL Payment_Type VARCHAR(20) NOT NULL Payment_Time TIMESTAMP NOT NULL FOREIGN KEY (Payment_ID) REFERENCES Payment(ID) ); ``` In the above design, each table has a unique ID as the primary key to ensure the uniqueness and integrity of the data. At the same time, in order to support multi-currency transactions, the payment information table also included a payment type field to distinguish different payment methods.

Latest Questions
What are some better themes for Thomas and Emily in fanfiction instead of sex?
3 answers
2024-11-12 16:03
Adventure themes. They could go on an exciting journey together, exploring new places and facing challenges.
What are the common themes in Hermione and Seamus fanfiction?
1 answer
2024-11-12 16:02
There are several common themes. Firstly, there's the theme of redemption. Maybe Seamus has made some mistakes and Hermione helps him redeem himself. Secondly, the theme of love against all odds. Their different social circles and personalities in the original story make a relationship between them seem unlikely, so fanfictions often play with this idea. And lastly, the theme of discovery, both of themselves and of each other, as they interact more closely than in the original series.
Can you recommend some good 'naruto cuchulainn fanfic'?
3 answers
2024-11-12 16:02
One good 'naruto cuchulainn fanfic' could be 'Naruto and Cuchulainn's Unexpected Alliance'. In this fanfic, Naruto might meet Cuchulainn in a strange dimension and they have to work together to overcome various challenges. The story could explore how Naruto's ninja skills and Cuchulainn's heroic abilities complement each other.
How can I find rare ps2 visual novels?
3 answers
2024-11-12 16:02
You can try looking in second - hand game stores. They often have a collection of older games, including some rare ps2 visual novels. Another option is to check online marketplaces like eBay or Amazon, but be careful of counterfeits. You could also join some gaming forums or communities dedicated to ps2 games. People there might be selling or trading rare visual novels.
English Drama with Boss and Assistant: A Love Story
1 answer
2024-11-12 16:02
The English drama about a boss and an assistant in a love story could explore many themes. Such as the contrast between professional and personal life. The boss could be a very confident and successful person in business but becomes vulnerable when it comes to love. The assistant may bring out a softer side of the boss. They might have some sweet moments like sharing a coffee break and slowly realizing their feelings for each other.
Who are the main characters in the 'angraj karn hindi story'?
1 answer
2024-11-12 16:02
I'm sorry, but without having read the 'angraj karn hindi story', it's difficult to determine the main characters. However, in Hindi stories, characters can range from heroic warriors to wise sages, or even common people with extraordinary qualities. So the main characters in this story could be any of these types depending on the nature of the story.
What are some good wholesome fiction books to read?
2 answers
2024-11-12 16:02
One great wholesome fiction book is 'Anne of Green Gables'. It tells the story of an orphan girl, Anne, with her vivid imagination and kind heart. Another is 'The Little Prince'. This book is full of profound yet simple truths about friendship, love, and the nature of humanity. Also, 'Charlotte's Web' is a wonderful choice. It shows the beautiful friendship between a pig and a spider, teaching about loyalty and selflessness.
Fanfiction: What if Tony Stark Joins Thanos?
1 answer
2024-11-12 16:02
In this scenario, it would be a complete shocker. Tony Stark is a hero, and Thanos is a villain. If he were to join Thanos, it might be because Thanos somehow convinced him that his plan was for the greater good. Maybe Thanos showed him a future where overpopulation and resource depletion were so bad that his 'snap' was the only solution. But this would go against everything Stark stands for, so it would be a very complex and dark turn for his character.
What are the different senses of science fiction?
3 answers
2024-11-12 16:02
The senses of science fiction can include a sense of wonder. It makes readers or viewers marvel at the futuristic concepts, like advanced technologies and new civilizations. For example, in 'Star Trek', the warp drive and diverse alien species create this sense.
What are some interesting spiked dildo stories in fiction?
1 answer
2024-11-12 16:02
I'm sorry but such topics are inappropriate and not suitable for general discussion. We can focus on positive and family - friendly fictional stories instead, like those about heroic adventures or heartwarming friendships.
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z