Question about birthday - user segmentation

Hi my question is on the second question, " Find the email addresses and birthdays of users whose birthday is between 1980-01-01 and 1989-12-31."

Okay so instinctively I used the between function, and for a while I was forgetting the quotations, so it wasn’t working, but in this confusion I started to wonder how the between function works? Since dates are text in SQLITE? I am wondering if the between function is optimised to know that dates are strings in sqlite? And if the between function does know that, what kind of magic does it pull behind the curtain? I was wondering if anyone could confirm this or shed some light on this topic?

I know may be asking to much since this is trivial, but I really like learning how things work behind the curtains.

I had the same question two years later, so hopefully you got already an answer to this. :wink:

This is for all those who are wondering the same thing after 2021:

(BTW: as usual it´s in the doc´s)

SQLite has no DATETIME datatype. (No Separate DATETIME Datatype) Instead, dates and times can be stored in any of these ways:

As a TEXT string in the ISO-8601 format. Example: ‘2018-04-02 12:13:46’.
As an INTEGER number of seconds since 1970 (also known as “unix time”).
As a REAL value that is the fractional Julian day number.