PDA

View Full Version : query help


angel2006
04-20-2006, 08:18 PM
:confused: hi, could someone please help me with this query,

i have these tables for the query:

lecture: lecture_id (PK), module_code(FK), lec_date

module: module_code(PK), info about it...

student_modules: student_id(FK), module_code(FK)

student: student_id(PK), student details...

i need to work out which students are taking which modules, then from that result, which module has which lecture. So in the end i want to create a new form which will allow me to create a check box for attendance for that student's lecture.

could some 1 help????

guelphdad
04-20-2006, 08:43 PM
Sure, what have you done so far towards coming up with an answer?

Probably the best thing to do is answer the first item first work out which students are taking which modules.

Do you have a join for that?

angel2006
04-20-2006, 09:05 PM
Sure, what have you done so far towards coming up with an answer?

Probably the best thing to do is answer the first item first work out which students are taking which modules.

Do you have a join for that?


so far i think the query will look something like this:

SELECT student_id FROM student,student_modules where module_code = ????

SELECT * lecture_id from lecture where module_code = ????:confused:

guelphdad
04-21-2006, 03:09 AM
From your first query in that post I'd say you don't have a grasp on table joins.

Have a look at a tutorial on joins, specifically using the ON clause syntax.