What kind of relationship for this case?

Asked

Viewed 47 times

1

I am a programmer beginner in C# and would like to help my company get off the paper, is an Ice Cream Factory.

We make available freezers for clientes. I am developing a system that manages the freezers that each cliente has. A Customer can have multiple freezers of various types.

Example:

Ice cream shop Claudinho can have 1 vertical freezer, 2 horizontal etc....

It is a ratio 1 to N?

Table Cliente = idCLient, namFantasia, Cnpj, address;

Table Freezer = idFreezer, model, voltage, capacity, quantity;

Or N to N ?

  • 1

    What is the Freezer x Client relationship? If it is the current locations, a freezer cannot be in more than one customer and therefore would be 1xN; but if it is all locations, a freezer can be leased by different customers in different time spaces, being an Nxn relation.

  • 1

    It depends on how you handle the data... Like what Anderson commented above, you may also need to have an auxiliary table to have a history of who the freezers have already been rented for, this is all very broad and needs a deeper analysis than you need in your system :D

1 answer

0


For you to better understand how to make this relationship and make a description with everything that should be present in the bank.

Example:

  • 1 Freezer can have many models, but 1 Model can have a freezer
  • 1 Customer can have multiple freezers, but a freezer can have only 1 customer.

In this case we have two relations 1 for many.

The freezer relates to models and relates to customers, if this relationship is different, as I do not understand your business rule well, but for example...

  • 1 customer many freezers and 1 freezer many customers.

In that case you would have many for many of whom you would need to create a specific table for that relationship.

For example: freezercliente 1 for many with freezer and 1 for many with customers.

Pay close attention in these many links for many a table many for many must be directly related, it would be impossible to administer.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.