Hello everyone !
I’m currently working on the SQL course inside the Data Science Specialization. In a project, I stumbled into something that tickle my brain.
I’m asked to find all the users registered in a database born in the 80’s. The birth date is a TEXT data formatted like this ‘yyyy-mm-dd’ and the column is called birthday.
Given that the birthday is a TEXT, I figured the simplest way was to to use this query :
WHERE birthday LIKE ‘198%’;
My thought on that would be that if the date of birth does not start with “198” the user is not born in the 80’s. The two answer given by Codecademy was to use the comparison operator and my solution is not included. So that leads me to my question : am I missing something there ?
I got no “wrong” results using my query and I figured that maybe I would miss some of the people born in the 80’s, but I don’t understand how this would happen. Anyone got a thought on that ?
Thank you for your help !