Names Starting With A
EasySQLDatabaseSorting
Description
Write a SQL query to return the names of users whose name starts with the letter 'A', ordered alphabetically. **Output columns (in order):** name
Table:
users| Column | Type |
|---|---|
| id | INT |
| name | TEXT |
Examples
Input:
CREATE TABLE users (id INT, name TEXT); INSERT INTO users VALUES (1,'Alice'),(2,'Bob'),(3,'Aaron');Output:
Aaron
AliceExplanation:
The pattern match keeps only names beginning with an uppercase A, sorted alphabetically.
Input:
CREATE TABLE users (id INT, name TEXT); INSERT INTO users VALUES (1,'Zed'),(2,'Amy');Output:
AmyExplanation:
The pattern match keeps only names beginning with an uppercase A, sorted alphabetically.
Input:
CREATE TABLE users (id INT, name TEXT); INSERT INTO users VALUES (1,'Ada'),(2,'Ann'),(3,'Abe');Output:
Abe
Ada
AnnExplanation:
The pattern match keeps only names beginning with an uppercase A, sorted alphabetically.
Constraints
- •
Use standard SQL (SQLite).