I posted about a week or a database structure that I am trying to create. I did not take enough of the complexity of this, so I am posting again. In the example, I have used a CD collection as an example.
I understand that I need a lookup table to say my style or publisher. This is not a great deal for management.
But this project has eight search tables and some of these tables have 150 entries. As I had understood, what was suggested, I need to change the sequence of a separate entry and data for the CD, so if I said 20 entries in the average of one lookup table, then 20 x 20 x 20 X 20 x 20 x 20 x 20 x 20 permutations. Or am I mistaken? How can I effectively create a master table to draw all the data without a separate line for each permutation? Do I need to write some more complicated SQL to manage this?
Help!
A brief overview of adding tables to SQL using the CD example.
Each disk can have only 1 label, we create a table of labels that looks like this:
label Table in the CD table LabelID INT 11) No, When we want to see results we join it ... like:
multiple by one
Let's say that you have many relationships, then you need a joining table (I believe this is the place where you were getting confused.)
First of all Artist's table is available for all the artists available (Note Artist Table can have more data - Dob, Home Town ... etc)
artist table artist INT (11 ) No tap auto_increment primary key, artist name is VARCHAR (255), tap default '' Then we create an insert table. It will join many artists in a CD. One or more rows in the CD can represent each link to an artist in a table.
Key
Then you say that to select a list of artists for a particular CD
Select Artist.Cd2artist from cd2artist.artistid = artist.artistid Join Artist, where CDID = & lt; cd id is here Put & gt;
Comments
Post a Comment