Menu
Coddy logo textTech

Recap - Invoices

Part of the Beyond the Basics section of Coddy's SQL journey — lesson 11 of 27.

challenge icon

Challenge

Easy

Available 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:

  • id
  • year: the four-digit year as a string, e.g. '2026'
  • customer_domain: the domain part of customer_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