|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
I'm new here, so hello everyone!
![]() I'm not an experienced relational database designer but I'm not *completely* novice either. Now, I'm facing an urgent question that isn't covered (as far as I remember) by the litterature I've read up to this point. Using mySQL, I'm building a fairly complex database, of which one of the tables registers article authors. The problem is, I have to deal with two different "species" of authors : the ones that are members of the organization I'm working for, and the others. Those two kinds of animals are completely different. So obviously I have to put them in two different tables. Now, it may be a stupid question, because I lack experience and knowledge, and actually I hope it is a stupid question with a very straightforward answer, but... COULD SOMEONE (please!) TELL ME how to set up a many-to-many relationship when one of the manies include more than one table ? Without having problems making the join when I access the data ? Thanks and Cheers! |
|
#2
|
|||
|
|||
|
Due to the vagueness of the request, this is all I can offer:
TABLE NAME: AuthorInformation Columns for all appropriate author information Foreign Key Points to AuthorType TABLE NAME: AuthorType column1: PrimaryKey column2: Type of author (ex: Member of Fiction Group) If this doesnt work, please explain why this is no good so a more usuful answer can be deduced. |
|
#3
|
|||
|
|||
|
Thanks for your answer Kinivin, I apologize for the vagueness of my request. I'll try to make it clearer. And tell you why your suggestion wouldn't work, I think.
Author information is completely different depending on whether or not he/she is member of the group. I have an "articles" table made of the following columns : id, title, language, submitter, date and time of submission, date of publication, publisher, comments, of course the article's contents, and some more. I also plan on creating a lookup table linking the "articles" table (in a many to many relationship) to an "authors" table that still does not exist. The two different kind of authors (members/non members) are TOTALLY different. The information about member authors is actually nothing more than their members profiles. Other authors' info includes first and last name, a possible email address, and comments. So there are two different "authors" tables, and one of them is the "members" table (I'll have to create one for the non-members). And I need to link the "articles" table to these authors. Some articles have more than one author, and some authors have written more than one article. So it's a many-to-many relationship. I know how to create that when the problem is linking two tables : a lookup table. Two columns : authorID and articleID with the combination of the two being the primary key. But I don't know how to link my article table with TWO authors table in an elegant, orthodox way. I came up with half-a-dozen solutions that are all pretty ugly. And problematic when I'll have to retrieve data (remember I'm not an expert, those might be imaginary problems) : I'll need to include, on php-generated pages that describe articles, a column with the name of the author (whatever his kind) and a link to it's "profile" page (also php-generated of course.) I hope this longer request is more understandable. Thanks for your help! Hillel. Quote:
![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Question about relational DB design |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|