When a new user signs up, a product might auto-populate their display name with the local part of their email — the piece before the @. Using the users table, return name and username, where username is everything in the email column before the @ symbol. Sort by name.
users
| column | type |
|---|---|
| id | INTEGER |
| name | TEXT |
| TEXT |
| id | name | |
|---|---|---|
| 1 | Alice | alice@gmail.com |
| 2 | Bob | bob.smith@yahoo.com |
| 3 | Carol | carol123@outlook.com |
| name | username |
|---|---|
| Alice | alice |
| Bob | bob.smith |
| Carol | carol123 |
Everything before the @ is returned as the username. Dots and numbers inside the local part are preserved as-is.