Python Day 49 – finishing my SQL practice problems

It took me less than 2 minutes from sitting down at my computer to solve the practice problem that had completely stumped me yesterday. I guess time does heal all wounds :’)

I learned:

In general in SQL, but especially when joining two tables, the ordering of commands matters. The main issues I was running into yesterday was that I was attempting to GROUP BY and ORDER BY, and then afterwards add a WHERE condition. I learned that I need to put the WHERE condition first, and then the code works! It makes sense if you think about it, as the condition will select which values are even going into the groups/ordering. So conditionals needs to be executed first.

I think I’m understanding the basics of SQL now. I know there’s a lot more to go, but for tomorrow I’ll likely switch back to do some Pandas exercise problems. See ya later SQLite!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: