A multitable query references more than one table to retrieve or filter data. In practice, joins connect related rows so a condition in one table can identify values in another. section 17.1.4
Find titles by an author
To find prices for titles written by author 12, join title to titleauthor and filter on AuthorID. The titleauthor table connects the two entities in their many-to-many relationship. section 17.1.4
Common steps include:
- Start with a SELECT query to inspect the rows that an update will affect. section 17.1.4
- Join tables through matching keys, such as TitleID and AuthorID. section 17.1.4
- Use a predicate to filter the desired rows, then place the update syntax according to the database product. section 17.1.4
SELECT title.Price
FROM title
INNER JOIN titleauthor
ON title.TitleID = titleauthor.TitleID
INNER JOIN author
ON titleauthor.AuthorID = author.AuthorID
WHERE author.AuthorID = 12;
Browse the complete joined SELECT query, with an equivalent abbreviated form using table aliases. section 17.1.4
