# Practical SQL for Data Analysis

DevFeed: [Practical SQL for Data Analysis](<https://devfeed.tech/articles/practical-sql-for-data-analysis-33937.md>)

Original publisher: [Read original article](<https://hakibenita.com/sql-for-data-analysis>)

Author: Haki Benita

Published: 2021-04-25T21:00:00Z

Content type: tutorial

Language: en

Sources: [Haki Benita](<https://devfeed.tech/sources/haki-benita.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [Data analysis](<https://devfeed.tech/topics/data-analysis.md>), [pandas](<https://devfeed.tech/topics/pandas.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [articles](<https://devfeed.tech/tags/articles.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [data-analysis](<https://devfeed.tech/tags/data-analysis.md>), [database](<https://devfeed.tech/tags/database.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [pandas](<https://devfeed.tech/tags/pandas.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [practical](<https://devfeed.tech/tags/practical.md>), [python](<https://devfeed.tech/tags/python.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

This practical tutorial demonstrates how SQL can perform fast and efficient data analysis using a users table, comparing the approach with pandas and measuring memory usage. It reports that pandas alone uses about 37 MB and loading the data into memory adds about 300 MB, while the database table is 65 MB.

## Source excerpt

Pandas is by far the most popular tool for data analysis. It's packed with useful features, it's battle tested and widely accepted. However, pandas comes at a cost which is often overlooked. SQL databases has been around since the 1970s. They contain many features that most developers never heard of, and I want to bring some of them to light.