SQL HELP - how did rv come about


#1

I’m new to SQL (and programming). Can someone explain to me what “rv” stands for in this block of code? I’m guessing it’s a short hand for the table named recommended_values but no where did it rename the table to rv. This one of the learning modules I’m working on from codeacademy and I hate to move on b/c I have no idea how they came up with the short hand rv. Thank you!!!
SELECT
active_patients.Name as Name, round(LDL) as LDL,
active_patients.Address As Address,
active_patients.Phone as Phone
FROM
panels,
(SELECT Borderline_High, High
FROM recommended_values
WHERE LIPID = ‘LDL’) rv
JOIN active_patients on
panels.patient_ID = active_patients.ID
GROUP BY LDL
HAVING LDL>= rv.Borderline_High
ORDER BY LDL DESC;


#2

Personally, I found this whole project really badly explained, and difficult to work through. I ended up pretty much just copying the answers from the ‘hints’.

To be honest, it wouldn’t surprise me if this was a shorthand way of renaming the table that they just hadn’t bothered to explain. That would seem to be in step with the rest of the exercise.

My guess is that the line:

(SELECT Borderline_High, High
FROM recommended_values
WHERE LIPID = ‘LDL’) rv

is a shorthand for the ‘AS’ term we’ve been using elsewhere but it IS just a guess.