If you select the data from the
paintings table:
You will see the artist is represented by the
artistid, not the name or any other detail. That is how it should be in good database design, but it’s not convenient. In the previous chapter, you got around this by including a subquery:
SELECT
title,
(SELECT givenname||' '||familyname FROM artists
WHERE artists.id=paintings.artistid) AS artist
-- etc
FROM paintings;
Apart from being tedious, subqueries can also be costly in ...