- The Query
- Posts
- 🤓 a free SQL cheat sheet (desktop wallpaper)
🤓 a free SQL cheat sheet (desktop wallpaper)
Read Time: 3 minutes
Hey crunchers! The Query here — the data analyst newsletter that's like a dashboard for your data career. We'll provide you with at-a-glance insights to help you make data-driven decisions.
Here’s what we have for you today:
How to handle missing data 🙃
An e-commerce dataset for your next portfolio project
A SQL trick that your fingers will thank you for
Data memes 🤣
Announcement! SQL Cheat Sheet
When you’re first learning SQL, it can be frustrating when you don’t have the commands and syntax memorized.
That’s why we created a SQL Cheat Sheet!
To unlock it, here’s what you need to do:
Share The Query with one fellow data cruncher.
Once they sign up, we’ll send you 3 versions of the cheat sheet:
PDF
Desktop wallpaper
Mobile phone wallpaper
The easiest way would be to make a post on LinkedIn and share the link below!
def learn_data_analysis(👨💻):
1. A short and succinct guide to SQL
If you aren’t one for spending 20 hours learning SQL from courses (who has time for that anyway!?), give Soham Kamani’s SQL Guide for Beginners a look.
It’s a short and succinct guide to SQL summarizing all the main concepts you need to know.
2. How to handle missing data
When you’re working with a new dataset, a common problem is missing data.
So what is an analyst to do?
Alvira Swalin wrote an excellent guide on how to handle missing data.
Check it out here or just study the visual below:
select * from dataset-of-the-week
This week’s dataset is an E-Commerce Sales Dataset by The Devastator!
More and more purchases are being made online so there’s a higher likelihood than ever before that you’ll be analyzing e-commerce data at some point in your data career.
Here are some questions to get your analysis started:
Show sales volume and amount trended over time.
Show sales volume and amount by sales channel.
Show sales volume and amount by category.
Remember, try to uncover the story in the data!
class MiniLesson:
SELECT * EXCEPT
Ever find yourself typing out way too many column names in your SELECT statement?
SELECT statements can be brutal.
Save yourself from carpel tunnel and try SELECT EXCEPT.
SELECT EXCEPT is a useful feature in many SQL dialects that lets you select all columns in a table except for the ones you choose.
This can be super helpful when working with large datasets containing many columns.
Here's a brief example of how to use SELECT EXCEPT:
Consider a table called bike_sharing_rides with the following columns:
trip_id
, subscriber_type
, bikeid
, start_time
, start_station_id
, start_station_name
, end_station_id
, end_station_name
, duration_minutes
+ 20 more…
That's a lot of columns.
What if you don't need them all?
Instead of typing out all the columns except for the ones you don’t need you can use SELECT EXCEPT.
For example, if you want to query all columns except start_station_name and end_station_name, you can use SELECT EXCEPT as follows:
This will return a result with all columns except for the specified ones.
Next time your table has more columns than you’d care to type…
Breathe a sigh of relief and remember SELECT EXCEPT.
import memes as 😂
When your SQL code is a chaotic masterpiece of CAPS and lowercase…
That’s it for today.
Stay crunchin’ folks and see you next week!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
What'd you think of today's newsletter? |