简体   繁体   中英

How to design the database tables and relationships

I was creating a system for its purchases and transactions and initially thought the db would needed to be look like this.

https://imgur.com/0Agl7PZ

But after getting into the system

  • The products from the suppliers are needed to be bought time to time
  • The same product can be get from different suppliers.

So I changed the db to this way.

I'm still figuring out is this the best approach. And also is the product_purchase and order_products tables are many to many tables?

https://imgur.com/n1zFyC8

I suggest you to study about entity relationship model and all the phases of a database design (requirements, conceptual, logic, implementation). A wrong database design will influence negatively all the software that will be based on it in terms of performance and architecture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM