Relationship in tables in the database

Asked

Viewed 67 times

0

I have a table in the database called Veiculo and it has the following fields: placa, renavam, marca, cor and categoria.

To the placa and renavam is all right, since the data are unique.

My question is about the columns marca, cor and categoria. Today save everything on the table Veiculo and do not relate to other tables. It is necessary and/or recommended, through "good practices", to create a table for marca, another to cor and another to categoria and only refer to the respective ID on the table Veiculo?

The database behaves better this way, avoiding repeated information?

1 answer

0

Yes, better relate tables by agilidade and mainly economia de espaço.

For example: All registro of a car "black" you will have 5 caracteres correct ?

If you have a tabela relacionada, would only be the chave (I believe 99 colors is muuuuuita color, so only 99 = 2 characters).

Also at the time of consulta, the more data the greater the processamento.

Basically that’s it.

  • Right and every time you need a color do a JOIN...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.