Jump to content


Photo

database table structure


  • Please log in to reply
1 reply to this topic

#1 dbdummy

dbdummy
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 24 June 2006 - 08:43 PM

Hi,

I am trying to figure out how to create my tables and am somewhat stuck, database structures totally confuse me.

My end result needs to be a schedule of courses offered in various cities. ie

City: Austin
Course: 101
Course Description: 101 is this
Date: June 5, 6
Course: 102
Course Description: 102 is this
Date: June 7, 8, 9
Course: 103
Course Description: 103 is this
Date: June 10, 11, 12

City: Houston at Someplace
Course: 101
Course Description: 101 is this
Date: June 7, 12
Course: 112
Course Description: 112 is this
Date: June 13, 14, 14
Course: 123
Course Description: 123 is this
Date: June 18, 19, 20

So, I created a table named cities (not even sure if I really need a cities table, but the names can be quite long...ie, the city name may contain where the location is, ie, Tucson at River Rd. and Campbell Ave.

in cities I have
- place (primary key)
- city_name
- city_location

I created a table named courses
in courses I have
- ckey (primary key)
- course_number
- course_name
- course_description

then I need to create a table named schedule

this is where I am most confused

I need to know the city_name, city_location, course_name, course_description and the dates for that particular course in that particular city.

any help is appreciated.



#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 25 June 2006 - 05:31 AM

A simple lookup table with a few FKs from your other tables should suffice.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users