SunQuest
           Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old July 22nd, 2003, 10:56 PM
Hillel Hillel is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 Hillel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Question about relational DB design

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!

Reply With Quote
  #2  
Old July 22nd, 2003, 11:21 PM
Kinivin Kinivin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: NJ
Posts: 16 Kinivin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old July 23rd, 2003, 12:01 AM
Hillel Hillel is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 Hillel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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:
Originally posted by Kinivin
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Question about relational DB design


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway