Days with us

The loyalty team wants how many days each customer has been with us, counted from joined_date until today. SQLite's julianday() turns a date into a day number, date('now') is today — subtract the two and ROUND to a whole number, as days_with_us.

Tables in this exercise
customers
id first_name last_name email city country joined_date support_rep_id

Back to the chapter