AnalystPath

Gyms With Membership Growth in 2023

SQLEasyJunior level~15 min

Problem

Table: `GymBranches`

```text
+-------------+------+
| Column Name | Type |
+-------------+------+
| branch_id | int |
| season | int |
| net_signups | int |
+-------------+------+
(branch_id, season) is the primary key for this table.
Each row records the net change in active members at a gym branch during a given season.
net_signups can be negative when more members cancelled than joined.
```

A fitness chain wants to know which branches actually grew their membership during the 2023 season.

Write a solution to report the `branch_id` of every branch whose net_signups in season 2023 was strictly greater than 0.

Return the result table in any order.

Tables

Example rows — the live problem includes the full dataset.

GymBranches
branch_idseasonnet_signups
1202250
12023120
22023-30

Expected output

Your answer should return 2 rows with the columns branch_id.

Starter code (SQL)

SELECT *
FROM GymBranches;

Solve this SQL question free

Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related SQL questions