Essential SQL Queries That Data Analysts Should Have Known

Chi Nguyen
Geek Culture
Published in
6 min readMay 28, 2022

--

Photo by Brooke Lark on Unsplash

Introduction

SQL is a well-designed and vital language to help us explore and understand the data. Long story short, instead of processing massive datasets in Python or R, the first step in analytics should be to extract helpful information from our data using SQL

As you may see, there has been a lot of discussion on how important it is to acquire and master SQL as one of the essential skills for any data analyst or data scientist. Therefore, in this article, I will not again mention or emphasize the usefulness of SQL but will introduce you to a list of SQL queries widely used and helpful in different analytic tasks. To note, throughout this article, SQLite is the main tool for usage.

Find duplicated rows in a table

Often, when starting doing an analysis, I want to check if there are any duplications in my dataset that may affect my analysis. For example, I have a simple table of sales data of a store as below:

Figure 1: Data Sales — Data by Author

As you can see, the sales are duplicated for day 9. However, it will be hard for you to see the duplications in a more massive dataset…

--

--

Chi Nguyen
Geek Culture

MSc in Statistics. Sharing my learning tips in the journey of becoming a better data analyst. Linkedin: https://www.linkedin.com/in/chinguyenphamhai/