## 2.6. Joins Between Tables

[]()

 Thus far, our queries have only accessed one table at a time. Queries can access multiple tables at once, or access the same table in such a way that multiple rows of the table are being processed at the same time. Queries that access multiple tables (or multiple instances of the same table) at one time are called *join* queries. They combine rows from one table with rows from a second table, with an expression specifying which rows are to be paired. For example, to return all the weather records together with the location of the associated city, the database needs to compare the `city` column of each row of the `weather` table with the `name` column of all rows in the `cities` table, and select the pairs of rows where these values match.[<sup class="footnote" id="id-1.4.4.7.3.6">[4]</sup>](#ftn.id-1.4.4.7.3.6) This would be accomplished by the following query:

```
SELECT * FROM weather JOIN cities ON city = name;

```

```
     city      | temp_lo | temp_hi | prcp |    date    |     name      | location
