-2

I´m starting in database schema. I don´t have experience in it.

I am thinking of a platform for customers to have access to the types of products that suppliers offer.

So, I would like to know how to keep the database schema following the tables and their relationships.

The customer will be registered in the system and he will have access to suppliers and their products.

Costumer>>>>>>>>>Product>>>>>>>>>Supplier

I already thank anyone who can help.

greetings

Ed

  • Is this a homework question? You've also not given a lot of details. Will customers be limited to only see a certain set of products or will they be limited based on the supplier they have access too? Just an example of one of the many questions – JoshBerke Jan 15 '21 at 18:38
  • Sorry, Mr. JoshBerke. Yes, as you can see from my reputation. I understand the details of each entity. My doubt is among the relationships of these entities mentioned. – Eduardo Sampaio Jan 15 '21 at 18:44
  • @JoshBerke The client will search the platform for any product from any supplier. Basically it would just be an indication that such a supplier or suppliers has the product or products that the customer is looking for. – Eduardo Sampaio Jan 15 '21 at 18:49

2 Answers2

0

Customers generally don't have a direct relationship with Products. Generally, customers create orders, composed of multiple products.

So customers typically have a one to many relationship with an 'Orders' table. The Orders table has a one to many relationship with an OrderItems table. That table might store quantity, color, etc, and has a many to many relationship with the Products table.

Of course, that's just the typical entity relationship. Without more information, it's hard to know if it meets your needs or not.

0b1
  • 1
  • Thanks for infos. But here is there´s not orders. The platform will be a directory for consultation, where the customer will search for the product offered by the supplier. I'm sorry, I don't know if I was still clear. – Eduardo Sampaio Jan 15 '21 at 18:59
0

Based on the data you've given.

You would have a Product table, a product can be sold by one or more supplier. So you would have a Supplier table. Since this is a many to many relationship you would have a cross reference table

Customer's wouldn't be related to Products or suppliers.

Example Schema

JoshBerke
  • 66,142
  • 25
  • 126
  • 164