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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.