Member-only story

Why you should not use “SELECT * FROM TABLE” in SQL

Amy (Data according to me)
6 min readJan 29, 2025

--

Using SQL for data analysis always requires writing a good deal of queries, and sometimes, SELECT * seems like the easiest query to get your answer. It’s simple, straightforward, and gets the job done, right?

There are so many use cases and articles that suggest that this is bad practice, but not a lot of them tell you why it’s bad. Many of them recommend specifying columns, which is correct, but in this article, I will take it a step further and give you some reasons why it’s bad to use SELECT *.

Many SQL developers, many of whom learned SQL by doing: SELECT * from Table in the Oracle database, may disagree, but as a data analyst, I will share some reasons why this is bad practice.

Nothing says I’m a beginner like SELECT *

1. Fetching more than you need: Irrevant I/O

When you use SELECT *, the database retrieves ALL columns in a table. Sometimes, you don’t need all the columns, maybe just the ID or amount spent greater than a certain number of the first 10 users, but SELECT * returns all the columns in that table.

This can be a problem if you have a large dataset with many tables and columns. It comes with a cost. It can result in wasteful I/O cycles at the back end.

--

--

Amy (Data according to me)
Amy (Data according to me)

Written by Amy (Data according to me)

data analyst (SQL, Python, Excel, Tableau, SPSS), spreadsheet advocate, freelancer, sitcom lover by night, cinephile by weekend...

No responses yet