HomeInterview QuestionsWhy should you avoid using SELECT * in SQL queries…

Why should you avoid using SELECT * in SQL queries?

🟢 Easy Conceptual Junior level
2Times asked
Jul 2026Last seen
Jul 2026First seen

💡 Model Answer

Using SELECT * pulls every column from a table, which can lead to several problems:

  1. Performance Overhead – The database must read all columns, even those not needed, increasing I/O and memory usage. In large tables, this can be costly.
  2. Network Bandwidth – Transferring unnecessary columns consumes more bandwidth, slowing down client applications.
  3. Schema Fragility – If the table schema changes (e.g., a new column is added), queries that rely on column order or implicit assumptions may break or produce unexpected results.
  4. Index Utilization – Query optimizers can use covering indexes when specific columns are requested. SELECT * forces a table scan, negating index benefits.
  5. Readability & Maintainability – Explicit column lists document intent, making queries easier to understand and maintain.

Best practice is to list only the columns you need, use aliases for clarity, and rely on projection pushdown in modern engines. This improves performance, reduces coupling to schema changes, and makes your code more robust.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500