Questions regarding the design of the Android DB table. (Even if it's not an Android environment...)

Asked 2 years ago, Updated 2 years ago, 43 views

Hello, db design because I don't know a lot of help to the table please.

For example, a DB for managing Olympic record winning records was created as follows: The reason why I put the type column is that I have to process the data by track and field or swimming competition.

However, you can also create the same DB as the following: In this case, if you want to process the data for each competition, you can process the data for each track or swim competition by reading the game column to see if it starts with 'athletics_' or 'swimming_'.

The former does not need to contain a type-separated code instead of one more table column, and the latter will contain a type-separated code, which reduces the table column by one.

Which of the two table designs is desirable?

Do I have to make the DB table a 3rd regular type?

If it must be made into a third regular type, does the name, type, and game columns in the former table have transitional function dependencies?

database android

2022-09-22 14:53

1 Answers

It's hard to say which one is better for DB design, but in general, the former looks better than the latter. (That's my personal opinion)

The reason is that if you do it with the latter, you have no choice but to use a like sentence when searching for a field or item. (If you design it like the former, you can hash for each type and game, so it's efficient.)

You don't have to follow the third regular type. The DB design that fits the type of service is the best. (You can tell from the fact that NoSQL is popular these days.) ~)


2022-09-22 14:53

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.