You have created a large number of tables where you don’t really need them other than for a look-up. And even then you are doing it the wrong way. You are forcing a vast number of joins to get at data that is actually just an ordinary attribute of another table. These tables are very easy to spot, as they all follow the same pattern.
For example, type{idType, type} Firstly, you don’t need the integer based id, as I’m willing to bet that there are not two types with the same name but a different id. Type is in fact it’s own primary key, and so the idType is not needed. But to get at the value of the type (REALLY bad name for something in a database or program!) you must do a join, based on the idType, to retrieve the type value.
You do this dozens of times. So when you write a query it will be horrendously complicated with 13 unnecessary joins to retrieve the attributes of a release! You should be storing the actual attribute’s value in the release table, not a list of numbers, each forcing a join to find out what value it represents.
You will need a query with 8 joins to read the attributes of vinyl for example.
The tables that are wrong are so easy to identify, as they all have the same structure:-
Xyz {idXyz, Xyz}
A lookup table should just have this structure:-
xyz {xyz}
Then the value (xyz) will be in the table where you currently have your lists of foreign keys - a list of numbers - and thus no joins will be needed to retrieve the values of the attributes. Your current design will be a nightmare to retrieve data from.
Basically, you are under the total wrong misapprehension that every table needs an integer as the unique identifier for each row.
Wrong, because there are such things as natural keys - go read up on that.
But for example
country{id, name}
1, Scotland
2, England
3, France
4, Germany
5, Spain
6, Columbia
the country name is unique, it should be the primary key in that table (and primary keys are automatically an index, so no need to add one), the country look-up table ONLY needs to list the name, and the name will be stored as an attribute on some other table.
There is only one country called Scotland, it has no need of a number to identify it (although we all know it is the No. 1 country of course)