I have four tables by the name candidate, program_type, program_of_interest and desired_intake. The table candidate has a many to one relationship with the rest of the three tables.
The candidate table looks like this:
The program_of_interest table:
I am trying to replace the program_type,program_of_interest,desired_intake id's in the candidate table with the corresponding values in their respective tables. I am able to select the values as needed with help from this thread SQL Replace multiple variables from another table in query result. Here is my solution to select:
SELECT
c.id,
p.value as 'Program type',
p1.value as 'Program of interest',
d.value as 'Desired intake'
FROM candidate c
JOIN program_type p on p.id = c.program_type
JOIN program_of_interest p1 on p1.id = c.program_of_interest
JOIN desired_intake d on d.id = c.desired_intake
My question is how do I replace the ids in the candidate table with their respective values?