Filed under L
- O(1) · Trivial
- Free
- SQL
- strings
- filtering
Problem
In a library's card catalog, a title isn't filed under its article: "The Lighthouse" goes under L, not T. The librarian wants to go through the cards where that happens, one by one.
Show two columns, the id and the title, of every book whose title has "The" or "A" as its first word.
What it has to return
These rows, in any order
| id | title |
|---|---|
| 1 | The Lighthouse |
| 3 | The Blue House |
| 6 | The Train South |
This is what comes out with the data in the practice database this challenge uses. The column names don’t count, so name yours however you like: what counts is how many there are and the order they come in. Besides this one, the challenge has hidden tests with other data that are revealed when you submit your solution.
You start with this
SQL
SELECT id, title
FROM books
WHERE title LIKE 'T%'Solve this challenge
It opens in your browser, with the editor and the tests. It is free and you do not need an account to start.