MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 23rd, 1999, 12:57 PM
xale
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
good evening!

i'm building my first sql (mysql) database
and i'm faced with a little big problem.
(but not the first one i query...)

i'd like to have the following structure:

id=1 nom=musique
id=2 nom=theatre

id=10 nom=disco ref=1
id=11 nom=concert ref=1
id=12 nom=theatre d'objets ref=2

id=100 nom=pop ref=10&11
id=101 nom=rock ref=10&11
id=102 nom=punk ref=10


so, pop and rock appear in the group
disco an concert and the tree are under
music... but punk can only appear in concert/music...

can somebody help me? does anybody know
where i can lern a little bit more of
table architecture (if possible free and
on-line! ... i have plenty of time and
a litle bit less of money... sorry...)?

thank you. ciaaaaaaao

a.l.e

Reply With Quote
  #2  
Old October 26th, 1999, 01:04 PM
DesertFox
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
a.l.e.

Hi,

You can have 1 huge table and list all possible combinations.

NOM1 NOM2 NOM3
musique disco pop
musique concert pop
musique disco rock
musique concert rock
musique disco punk
theatre theatre d'objets


But, making 3 tables:

First table will be:
T1-ID NOM
1 musique
2 theatre

Second Table:
T2-ID NOM T1-ID
10 disco 1
11 concert 1
12 theatre d'objets 2

Third Table:
T3-ID NOM T2-ID
100 pop 10
100 pop 11
101 rock 10
101 rock 11
102 punk 10


The various T?-ID are your "linking fields" (The fields that will relate all three tables together).

Hope this helps.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > designing a structure


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 1 hosted by Hostway