1
The project consists of a database for RPG sheets (D&D and the like). It was like this:
Database
record sheetTables
- character
- system
- raccoon
- class
- attribute
- personagem_attribute
Relationships
- CHARACTER = N ====== 1 = SYSTEM
- CHARACTER = N ====== 1 = RACE
- CHARACTER = N ====== 1 = CLASS
- CHARACTER = N ====== N = ATTRIBUTE == PERSONAGEM_ATRIBUTO
In the "attribute" table there are attributes that can contain text (e.g.: Background), numbers (e.g.: Force points = 15), text and numbers (e.g.: Arc, Damage distance 2D6, Damage body to body 1D6).
How can I create this in the table personagem_atributo
?
I thought of creating a column (attribute) with the name valor
with the guy varchar
, but that way I get stuck with just the guy varchar
. How do I manage to assign type to value according to the information provided (int
, text
, varchar
)?
Your question goes against the concept of RELATIONAL banks, but the only solution I know for your doubt is in the structure of Nosql Banks. In this type of bank each tuple has its individualized and changeable typing in the next.
– Danilo Araujo
Thank you so much for your help. I’m still new in the area so sorry if the questions are basic. But is the Nosql form still in use today? I saw that the relational model is the most current so I thought this would be the best model to be used in a database.
– Hidemitsu Goncalves Hashimoto
If the value can be alphanumeric, then there is no doubt, it must be
VARCHAR
. I think there is no need to complicate. If you need to later you can make aCAST
for the kind you need!– João Martins
Got it. Thanks a lot for your help.
– Hidemitsu Goncalves Hashimoto
@Hidemitsugoncalveshashimoto The answer solved your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero