I'm worried about how to design the RDB column.How should I design it if there is a possibility of multiple elements in a single column?
For example, you want to design a table containing "watari," "wani," "sparrow," and "kamonohashi."At this time, you can store the following tables without any problems:
However, the platypus belongs to both mammals and reptiles because it lays eggs.
Therefore, the table looks like the following, but is there a better design?
Another design I've come up with is to create columns like "Mammals," "Reptiles," and "Fish," and manage them with Boolean variables. (Not very good)
I would appreciate your advice.
What kind of structure is good depends on what you want to express (what kind of use you want to use it for).
The "may contain more than one element in a column" state is called the non-regular system, and the operation to correct that state is called normalization.
If you simply want to normalize it, I think it would be like this:
Italics are the main key.
The procedures for normalization like this are frequently mentioned in the Information Processing Technician Examination, so you may want to refer to your commentary book/site.
They say that the platypus is an egg-laying mammal (not a reptile) (Wikipedia), so if you want to express "egg-laying or not", you may want to set up a different item instead of "like".
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
911 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.