Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
CAST. CAST(x AS type) converts a value to another type: CAST(order_date AS VARCHAR) gives text, CAST('42' AS INTEGER) gives a number. You need it when one column mixes types, for example COALESCE of a date and a text label: turn the date into text first.
select order_id, cast(order_date as varchar) as order_text, cast('2025-12-31' as date) - order_date as days_to_year_end from orders limit 5The year-end delivery board lists the last shipments of 2025. Each one should show its delivery date, or 'In transit' if it hasn't arrived.
For shipments with a shipped_date on or after 2025-12-29, plus those with no shipped_date yet, return order_id, carrier and delivery: the delivered_date as text, or 'In transit' when it is missing.
Loading the Brightline dataset…
Language
Full plan
SQL ✓ · Excel and Power BI also included
Cancel anytime · 14-day full refund · Secure payment by Stripe