Home > database >  Design database tables outside the healthy
Design database tables outside the healthy

Time:09-20

The product table P, fields: ID, symbols, brand
Product table P1, fields: ID, market, product ID P
Product P1 release form, fields: ID, the release time, publish price
The release table is a foreign national health ID, P1 is P associated products or product good?
Consult everybody answers and give reasons

CodePudding user response:

Assume that P and P1 is a one-to-many relationship, that is, a product can release is not in the same market,
P1 is product release in the table should be associated products P1, namely a product in different regions will be released at different times and different prices for

The key is to see the business logic,

CodePudding user response:

Don't use foreign keys, made a small 20 years of the database, foreign keys that dongdong, do a lot good, don't need to trouble,

CodePudding user response:

Do you let the database to limit the benefits of the program is convenient, but there is a problem, he is not so good as program control, see you write the code ability strong or weak, it is better to process control,

CodePudding user response:

Brothers, and ultimately with no foreign keys, never dare to use foreign keys, collect the experience,
  • Related