Information in multiple tables or just one? [closed]

0

I have a lot of information that I need to save to the database. Some of this information is very similar:

Example: time1, time2, time3, ... hour10.

My question is whether to store everything in the same table or create a table for the information and a specific one to store the hours by putting a foreign key of the first table in the times table.

Next create a view with everything.

What will be best?

    
asked by anonymous 01.09.2016 / 19:06

1 answer

1

Create another table to register the hours, since you can take into account that the number of fields would be hour1 .. horaN, so if in future you need to create another "time" just add a line .. < p>

And create another table by making the relationship between your table and the timesheet.

For example

Tabela nome

Id |  Nome
01 | XXXXXX
02 | YYYYYY
03 | WWWWWW

Tabela horas

Id |  Hora
01 | Hora1
02 | Hora2
03 | Hora3


Tabela Relacao NomeHoras

Id | IdNome | IdHora | Valor
01 |   01   |   01   | '00:00'
02 |   01   |   02   | '01:00'
03 |   01   |   03   | '02:00'
04 |   02   |   01   | '03:00'
05 |   03   |   01   | '04:00'

I hope I have helped!

    
01.09.2016 / 19:36