2 Replies - 4041 Views - Last Post: 02 July 2012 - 07:53 AM Rate Topic: -----

#1 LittleSoul  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 26-May 12

MySQL DB design; stuck and need help!

Posted 01 July 2012 - 04:58 PM

Sigh. Alright, so I'm designing my database, and I'm following along the rules of normalization; but I'm stuck.

I have many tables planned, with some relationships, and I'm making sure I write down primary keys and which table needs which foreign key.

While doing this, I realized that I have a situation where a field seems to need more than one value within it.
And I know that's very wrong, and it'll be a big pain later if I do it that way.
And I've got several tables that have the exact same problem.

What I've got is:

Clothing (Linked to MaterialDegen, Tools, Resources)
-Name
-Primary Key (Clothing)
-Degen FKey
-ReqResources
-ReqTools

I have tables like this, where they have required items and resources in order to be made.
Like for tools, if it's a silk dress, you have to have scissors, a sewing needle, and a loom.

I have a tools tables already, the problem is I can't put more than one tool id at a time into the clothing table.
I'm not really sure how to continue forward; I think I'm missing something.
These values will never change, just in case anyone asks.

I'd be so grateful for any help.

Is This A Good Question/Topic? 0
  • +

Replies To: MySQL DB design; stuck and need help!

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6106
  • View blog
  • Posts: 23,654
  • Joined: 23-August 08

Re: MySQL DB design; stuck and need help!

Posted 02 July 2012 - 04:03 AM

You need a Junction table.
Was This Post Helpful? 3
  • +
  • -

#3 LittleSoul  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 26-May 12

Re: MySQL DB design; stuck and need help!

Posted 02 July 2012 - 07:53 AM

I'm silly. I think I was working so hard last night I had a brain dead moment.

Thank you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1