Registrar's Reconciliation
Fairhaven University has just moved its student records onto a new system, and the registrar will not sign the migration off until both sides agree on one number: how many students the university actually has. Every downstream report — funding, room planning, the accreditation return — is built on that figure, so it gets checked before anything else.
The awkward part is that a student shows up over and over in the rest of the data, once for every course sitting on record. "How many rows are there" and "how many students are there" are different questions, and the registrar wants the second one.
students — one row per enrolled student. gpa is the grade point average already on file for that student, on a 0-4 scale.
| id | name | major | gpa |
|---|---|---|---|
| 1 | Nora Fischer | Computer Science | 3.8 |
| 2 | Omar Haddad | Statistics | 3.4 |
| 3 | Petra Novakova | Computer Science | 3.9 |
| 4 | Quinn Walsh | Mathematics | 3.1 |
| 5 | Ravi Shah | Statistics | 3.6 |
The table already exists in the database — there is nothing to create or load.
Task: Write a query that returns one row with one column, total_students, holding the number of students enrolled at the university.
Example output
If two hundred and forty students were on the books, the single row would read:
| total_students |
|---|
| 240 |
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in