Data Science Interview Prep: SQL Cheatsheet

T Z J Y
CodeX
Published in
6 min readOct 14, 2021

--

Source: Alexandre Debiève from Unsplash

Data science interviews can be tough to navigate. The fact that it’s such a multi-disciplinary field means that the sheer volume of material you need to cover to feel properly prepared can become overwhelming.

Here I summarize most queries and put in “Cheatsheet” format, and hope this could help readers to cracking the data science interviews.

Categories

Finding Data Queries

SELECT: used to select data from a database

  • SELECT * FROM table_name;

DISTINCT: filters away duplicate values and returns rows of specified column

  • SELECT DISTINCT column_name;

WHERE: used to filter records/rows

  • SELECT column1, column2 FROM table_name WHERE condition;
  • SELECT * FROM table_name WHERE condition1 AND condition2;

--

--

T Z J Y
CodeX
Writer for

Quantitative Research | Data Sciences Enthusiast