I need the following code to still show rows from the AUTHOR table even if they aren’t called from any rows in the ALLOCATION table. Currently, the code shows all ALLOCATION rows with the appropriate foreign key data. I need it so that all rows from the AUTHOR table show up, even if they have no corresponding ALLOCATION row.
SELECT authid,sname,fname,B.bid
FROM ALLOCATION A
INNER JOIN BOOK B
ON A.bid = B.bid
INNER JOIN AUTHOR U
ON A.authid = U.authid
ORDER BY authid;
That is, some of the rows in the AUTHOR table are the foreign key of 0 of the rows in the ALLOCATION table. I need them to show up as well in a SELECT. authid, sname and fname are columns of the AUTHOR table.
1 Answer