need SQL query advice on cross referencing three tables
I'm trying to lear SQL. I'm a total noob, please bear with me.
I have these two queries, both of which work, but I'm hoping to get some advice as to which is preferable, or if there is a better way of doing it.
SELECT AVG(price) AS PriceAverage FROM bib inner join (SELECT sub.subcode, accno FROM sub inner join indx on sub.subcode = indx.subcode where subject = 'SOCIAL CHANGE')A on bib.accno = A.accno;
SELECT AVG(price) AS PriceAverage FROM bib inner join (select accno,subcode from indx where subcode in ( select subcode from sub where subject = 'SOCIAL CHANGE'))A on bib.accno = A.accno;
Best,
Kyle