Comment

Comment by hadley

I think this would really benefit from some thoughtful indenting to illustrate the structure. For example, instead of:

  SELECT
  members.firstname AS "First Name",
  members.lastname AS "Last Name"
  FROM borrowings
  JOIN books ON borrowings.bookid=books.bookid
  JOIN members ON members.memberid=borrowings.memberid
  WHERE books.author='Dan Brown';
Do:

  SELECT
    members.firstname AS "First Name",
    members.lastname AS "Last Name"
  FROM borrowings
    JOIN books ON borrowings.bookid = books.bookid
    JOIN members ON members.memberid = borrowings.memberid
  WHERE books.author = 'Dan Brown';
This helps reinforce that there is one FROM statement that combines three tables using joins
parent hadley 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton