Recap - Invoices
Part of the Beyond the Basics section of Coddy's SQL journey — lesson 11 of 27.
Challenge
EasyAvailable tables and columns:
<strong>invoices</strong>:<strong>id</strong>,<strong>code</strong>,<strong>customer_email</strong>
Every code is in the format 'INV-<year>-<number>' (e.g. 'INV-2026-00042'). Return:
idyear: the four-digit year as a string, e.g.'2026'customer_domain: the domain part ofcustomer_email, in lower case
Order by id.
Try it yourself
SELECT id,
-- year extracted from code
-- customer_domain from email
FROM invoices
ORDER BY id
All lessons in Beyond the Basics
2String Functions
LENGTH, UPPER, LOWERSUBSTRINSTRREPLACE and TRIMConcatenating with ||Recap - Invoices