Member-only story

SQL Vs Python Data Retrieval

Maw Ferrari
4 min readDec 23, 2022

SQL and Python are two essential languages for anyone interested in Data Science. In this post, we cross compare SQL vs Python Pandas data retrieving.

Table of Contents

· Introduction
· Retrieving data (simplest form)
· Conditional data retrieving

Introduction

SQL is the language used to interact with relational databases, by allowing a wide range of data operations: creating, loading, retrieving, transforming, etc. The interaction is implemented by running SQL statements on database tables.

Pandas is a library dedicated to data analysis and manipulation in Python. We can perform even a wider range of operations than SQL, if combining other libraries with Pandas (e.g. Machine Learning libraries, visualization libraries, etc.). The equivalent Pandas object of a database table is called a DataFrame.

In both languages, one of the fundamental operations is data retrieving, based on specific conditions. In this post we compare how to retrieve data in both languages, not to choose which is the best, but to learn both.

We’ll use a dataset with the products of a classic model retail company. Feel free to download it (file Classic Models — Products.csv ) from our original post…

--

--

Maw Ferrari
Maw Ferrari

No responses yet

Write a response