A gym records each class visit by member number. Member details live in a second table, exported from an old system.
visits:
| member_id | class |
|---|---|
| 101 | spin |
| 104 | yoga |
| 101 | yoga |
| 107 | spin |
| 104 | pilates |
| 102 | spin |
| 104 | yoga |
members:
| member_id | name | plan |
|---|---|---|
| 101 | Asha | monthly |
| 102 | Bilal | annual |
| 104 | Chen | monthly |
| 104 | Chen | annual |
| 105 | Dana | monthly |
To put a name on every visit, the manager runs:
Remember exactly how merge lines rows up: it takes each row of the left table and pairs it with every row of the right table that has the same key, writing one combined row for each pair. how="left" also keeps any left row that has no match at all, with NaN in the right table's columns.
How many rows does joined have? Enter a whole number.