I hypothetically have a publicação
table that has, by default, the autores
attributes (derived from a relationship table), titulo
, edição
, editora
and ano
. However, depending on the type of publication (such as livro
, artigo em periódico
, artigo em jornal
and others) there would be a need to collect additional data.
For example, if publicação
is of type livro
there would be a need to store quantidade de páginas
and volume
. However, a publicação
can be generic and does not have a type.
My question is: what is the best way to handle this situation?
I thought of two possible ways:
- Create a
publicação
table with the default attributes. - Add in
publicação
a columntipo
- Create a table for each possible type of publication with its particular attributes
- Relate these new tables to
publicação
and form a compound key
or
- Create a
publicação
table and add all possible attributes of the types and make the treatment in the server-side application. (this does not seem like a good solution)
I have little experience in database. I believe there are other solutions. I would like to know which ones?