Not sure what it is exactly that you are trying to do, but give these two a read
https://tray2.se/posts/database-design https://tray2.se/posts/database-design-part-2
I am not sure if there is design flaw already but how it works now is that there are many data tables (more than a hundred). Each of these data tables has a corresponding table in the DB.
I need to add a new column to all these tables - a dropdown with several choices.
What I then need to do is to have a new table which would display rows with the same selected value from all tables.
The tables have few identical columns and different data columns. The identical columns are inputs such as comments that the user can enter.
How should I design the new table:
It just feels weird to have so many UNIONs
The idea is to have 1 place that concentrates the rows with same dropdown selection. So not all the data has to be displayed, but the important ones - such as the original table that this row comes from, and the row id of it with the identical columns. The actual data might not be displayed in this table and instead a link to the original table can be given.
Example tables:
table 1:
id | d1 | d2 | d3 | identical_input1 | identical_input2 | new_dropdown_value
table 2:
id | d4 | d5 | identical_input1 | identical_input2 | new_dropdown_value
table 3:
id | d6 | d7 | d8 | d9 | d10 | identical_input1 | identical_input2 | new_dropdown_value
Wanted result (the columns to display, not necessarily a new table if that's not the solution):
table_name | foreign_row_id | identical_input1 | identical_input2 | new_dropdown_value
Ty
Please or to participate in this conversation.