I want to design a database to store crossword puzzles,
mainly I have 2 tables:
Questions Table, Grid Table,
Questions Table(q_id, question , answer…)
Grids Table (g_id, name, ….)
when I come to relate Questions Table with Grids Table, I am thinking of a good way,
Questions_Grid(q_id, g_id), the pair would be a primary key,
another solution that my boss suggested : Grids Table ( g_id, q_ids, ….)
q_ids store all the ids of the question used in this grid
which one is better? and if you have better options ?
It looks like your boss’s suggestion is to store a list of question ids as a text column in the grid table. If I understand what you’re asking and that’s really it, the first one is much better, of course, because it’s normalized. In your scheme, you can make many useful queries that would be messy or impossible (and slow, if possible) in your boss’s scheme.