~/ learn/ postgresql/ cards/ LEFT JOIN: keeping unmatched rows
1 of 2

Show every author's name and the title of each of their books, INCLUDING authors with no books in stock list (use a LEFT JOIN from authors). Columns: name, title.

Show every author's name and the title of each of their books, INCLUDING authors with no books in stock list (use a LEFT JOIN from authors). Columns: name, title.

Answer

SELECT a.name, b.title FROM authors a LEFT JOIN books b ON b.author_id = a.id;

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/4475ec21-caf0-4332-98d2-9ce971aac276/flashcard utf-8 LF