Where is Rick in the title?
LIKE, %, _ and DISTINCT · level 1 of 6
Opening your saved work…
Sign in to save across devices → · Download your guest work before switching accounts.
Where is Rick in the title? · LIKE, %, _ and DISTINCT · level 1 of 6
Names that start with R
Which speaker labels begin with R? Watch the query answer it with a pattern and DISTINCT, then run it.
Data: Rick & Morty.
Why it works, clause by clause
- WHERE characterName LIKE 'R%': an R, then any run of characters, including none. Rick on its own matches.
- SELECT DISTINCT characterName: one row per different matching name, however many lines each one has.
- ORDER BY characterName: alphabetical, so two people comparing lists see the same order. It ranks nothing.
From the reading: Where is Rick in the title?, paragraph 2
SELECT DISTINCT characterName
FROM scripts
WHERE characterName LIKE 'R%'
ORDER BY characterName;Query results
Run it to see the result here.Run it to see the result here.
Practice here is evidence for you and your instructor, never a grade. Grades live in Canvas.