Posted: Fri May 28, 2010 5:11 am Post subject: Help designing a simple database
First of all I'm a complete newb and I need help. I don't expect you to solve everything and am willing to make an effort.
I want to create a web page where I would track if a person was on a lecture or not. The HTML/CSS part is done, the PHP part will be, but the database part is what I don't know how to do.
This is what I need to do:
Person P1 attended lecture L1
Person P2 attended lecture L1
Person P3 attended lecture L1
Person P1 attended lecture L2
Person P2 attended lecture L2
...
There are about 20 persons, and exactly 15 lectures (L1-L15)
I created a table Lectures which has 2 fields LectureID (primary key) and LectureName. I also created a table Persons which has 5 fields, Person ID (primary key) and 4 others which describe that person.
I don't know how to "remember" the fact that a person was on a lecture. I definitely need to remember it so I can use it later.
er... how about a table for "attendance" with two fields, person ID and Lecture ID?
I think that is the only way. I don't believe that you can use a sql-query because your tables don't have any common column , so that they can be associated.
Joined: 21 Sep 2003 Posts: 16777097 Location: Portugal
Posted: Fri Jun 11, 2010 2:32 am Post subject:
AdamV wrote:
er... how about a table for "attendance" with two fields, person ID and Lecture ID?
That would be the obvious answer, indeed. This is the standard way to implement a many-to-many relationship -- which from what I understand, is what nowexam is trying to do.
If you want to make any type of the database either its simple or the complicated then the data tables and the queries are the most important thing that you have to make a good command over it.After that you will make all type of complicated database also.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
Featured Links*
Looking for more Windows Networking info?
Sign up to the WindowsNetworking.com Monthly Newsletter, written by Enterprise Security MVP Deb Shinder, containing news, the hottest tips, Networking links of the month and much more. Subscribe today and don't miss a thing! View a sample newsletter.
Become a WindowsNetworking.com member!
Discuss your Windows Networking issues with thousands of other Windows Newtorking experts. Click here to join!