I have two tables, one which stores the registered students, lets call it students_register. The second table keeps examination details of the students, lets call it exam_details. In the students_register table, i store:
student registration number
first name
last name
email_address
date_of_birth
and other details.
In the exam_details table, i store the registration number and the students marks in the different subjects.
Now, the challenge is that i want to query the exam_details table and display the data in a table but instead of displaying the students registration number, i want to associate the registration number in the exam_details table to that in the students_register table so that i can display the student's names instead of the registration number.
How can i go about this?
1. students_register table
id reg_number first_name last_name email_address dob
1 P2894 John Smith [email protected] 12/05/1990
2. exam-details table
id reg_number english maths chemistry biology physics
1 P2894 60% 80% 50% 72% 64%
How do i display this data in a table such that i have
first_name last_name english maths chemistry biology physics
John Smith 60% 80% 50% 72% 64%