Apr 15, 2026 · Day 4 of 30
Day 4: I wrote my first SQL queries today and suddenly data feels a lot more accessible
I took a small detour from Python today but an important one. I wrote my very first SQL queries.
I know what you might be thinking: isn't this an ML journey? Yes. But data for ML has to come from somewhere. And a lot of the time, that somewhere is a database you query with SQL. So this felt like the right moment to start.
Starting from zero
I had never written a SQL query before today. Not even a simple one. I knew the word "database" and that SQL was how you talked to it that was the full extent of my knowledge going in.
I started with the three most fundamental keywords: SELECT, FROM, and WHERE. And honestly? Within about 20 minutes, I felt like I could actually read data.
SELECT name, age FROM users WHERE age > 25;
That query just clicked immediately. You're saying: give me the name and age columns, from the users table, but only rows where age is greater than 25. It reads almost like plain English.
The moment it connected to ML
I kept thinking back to the Titanic dataset from Day 3. What if that data lived in a database instead of a CSV? I could query exactly the rows I needed say, only passengers in third class before even loading them into Pandas.
SQL isn't separate from ML. It's often the first step getting the right data out before you do anything with it. That realisation made today feel very worth it.
What the three keywords actually do
SELECT tells the database which columns you want. FROM tells it which table to look in. WHERE filters the rows based on a condition. Together, those three cover a huge amount of real-world data work.
SELECT survived, pclass, age FROM titanic WHERE pclass = 1;
I wrote that imagining the Titanic data in a database. First class passengers only. Three columns. Clean and specific. That's the power of SQL you don't have to load everything and filter in Python. You ask for exactly what you need.
What's next
I want to go deeper GROUP BY, COUNT, joins between tables. But today was about getting comfortable with the basics, and I feel good about where I landed.
Four days in and the pieces are starting to connect in ways I didn't expect when I started.
QUESTION FOR YOU
How important has SQL been in your ML or data work day to day? Is it something I should go deeper on early, or just know the basics and move on?
Top comments (0)