AnalystPath

Usernames Chosen More Than Once

SQLEasyJunior level~15 min

Problem

Table: `Signup`

```text
+-----------+---------+
| Column | Type |
+-----------+---------+
| signup_id | int |
| username | varchar |
+-----------+---------+
signup_id is the primary key. Each row is one signup attempt and the
username that was entered.
```

Write a query that lists every `username` that appears more than once in the table. Use the column heading `Username`.

Return the rows in any order.

**Example**

```text
Signup:
+-----------+----------+
| signup_id | username |
+-----------+----------+
| 1 | maple |
| 2 | cedar |
| 3 | maple |
+-----------+----------+

Output:
+----------+
| Username |
+----------+
| maple |
+----------+
```

`maple` was entered twice, so it appears in the result. `cedar` was entered only once, so it does not.

Tables

Example rows — the live problem includes the full dataset.

Signup
signup_idusername
1maple
2cedar
3maple

Expected output

Your answer should return 1 row with the columns Username.

Starter code (SQL)

SELECT *
FROM Signup;

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