Primary Key as a Foreign Key
-
Hello all, A quick question, I’m working on designing a SQL (7.0) database and for 37 of the tables I have 2 fields that are common between them and I’m using these 2 fields as the primary key for the 37 tables and also as the Foreign key to define the relations between these tables.
For example: Project_ID1: part of the Primary Key Project_ID2: part of the Primary key
Both of them together form the primary key for the 37 tables because they are the only unique fields within each table. And when I create a relation between 2 of the tables I use these same 2 fields as the foreign keys So, I would just like to get your opinion on if that is a correct design or not, I had some people telling me that this is a poor design? Thanks in advance -
Hello all, A quick question, I’m working on designing a SQL (7.0) database and for 37 of the tables I have 2 fields that are common between them and I’m using these 2 fields as the primary key for the 37 tables and also as the Foreign key to define the relations between these tables.
For example: Project_ID1: part of the Primary Key Project_ID2: part of the Primary key
Both of them together form the primary key for the 37 tables because they are the only unique fields within each table. And when I create a relation between 2 of the tables I use these same 2 fields as the foreign keys So, I would just like to get your opinion on if that is a correct design or not, I had some people telling me that this is a poor design? Thanks in advanceI didn't really understand right. Questions: 1. These 37 Tables do they all have the same Fields or what is different between them. 2. Do you store different Projects in different Tables? 3. Just show me the first 4 Fields of two Tables that I can understand. 4. What is the relation between the Tables? Database Design is more difficult than many people think. A good structure may help the developers. Please tell me more. Stefan