Jump to content

Database structure for a class registration system


benphp

Recommended Posts

Hi - easy question for db masters.

 

I have a registration system. I want to use the following tables:

 

Courses

cid|coursename

 

People

pid|first|last

 

Class

lid|cid|date|location|instructor

 

The Class table will contain registration data for a specific event.

 

My question is - is it better to have another field in Class called "Attendees" and add the pid separated by spaces/separator or is it better to create another table:

 

Class_People

lid|pid

 

and track the attendees that way?

 

Thanks!

You are better off creating the new table of Class_People. It is easier to just add them all to a table and then when you get the class id you can link the members of that class by the table rather than taking the data and having to do operations on it to get it to display how you want. Also in your class table you should probably break out the instructor and locations into their own tables. if you only have a couple locations its probably fine to leave that one there but I would break out the instructors into another table.

Go on the internet and download an application called Navicat. Once you have it open you can connect to your database. In there you can view your tables. The reason I am telling you about this program is because there is an option in there for query. If you select it you can build a query right in the program (visually) and run it. It makes it really easy to build complex queries.

Navicat - thanks, I'll try it!

 

Follow up question - since I'll have 20 or so Attendees for each event (Class), it's no problem then to have a zillion entries in the Class_People table? Figure about 40 classes/mo would be 800 entries/mo and 9600 records/yr.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.