Help designing a simple database

Networking/Security Forums -> Databases

Author: nowexam PostPosted: 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.

Please help me

Author: AdamVLocation: Leeds, UK PostPosted: Fri May 28, 2010 9:57 am    Post subject:
    ----
er... how about a table for "attendance" with two fields, person ID and Lecture ID?

Author: ark@s PostPosted: Fri Jun 11, 2010 12:31 am    Post subject:
    ----
AdamV wrote:
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.

Author: capiLocation: Portugal PostPosted: 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.

Author: juliadesusaLocation: us PostPosted: Wed Jan 12, 2011 1:20 pm    Post subject:
    ----
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.



Networking/Security Forums -> Databases


output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group