SQL Fundamentals : SELECT, FROM, WHERE
Extracting the Right Data Starts Here for Data Analysts
Series Note:
This article begins Series 4 (SQL Fundamentals) of the Shahnaz Insights roadmap.
We move from Python-based analysis to querying data directly from databases โ a core analyst skill. After focusing on decision-making in Series 3 -Part 4 (Hypothesis Testing), we now shift to extracting the right data โ because strong analysis starts with the right input.
Understanding:
In real-world data work, raw data lives inside databases.
Before any analysis, the first step is extracting the right data.
This is exactly where SQL comes in โ helping analysts select, locate, and filter data efficiently before moving to deeper analysis.
What You Will Learn:
- Use SELECT to choose needed columns
- Use FROM to pick the correct table
- Use WHERE to filter relevant data
- Apply conditions (AND, OR, BETWEEN, IN, LIKE)
- Write complete real-world SQL queries
๐ Learn to extract analysis-ready data, not just raw data.
๐Setting Up the Data:
Result:
What you learn: How to structure data before querying
What you observe: A clean dataset ready for analysis
Analyst interpretation: Data organization is the first step of analysis
1. SELECT โ Choosing Columns:
SELECT is used to pick specific columns from a table.
Result:
What you observe: Only required columns (name, age) are displayed
Analyst interpretation: Selecting specific columns reduces unnecessary data load and improves query efficiency
๐น Select All Columns:
Result:
โ ๏ธ Use * carefully (not efficient for large datasets)
Get Shahnaz Banoโs stories inย yourย inbox
Join Medium for free to get updates fromย thisย writer.
What you observe: All columns from the table are returned
Analyst interpretation: Useful for exploration, but inefficient for large datasets and production queries
2. FROM โ Choosing the Table:
FROM tells SQL where the data exists.
Result:
What you observe: Data is pulled from the specified table (employees)
Analyst interpretation: Correct table selection is critical โ wrong source leads to incorrect analysis
3. WHERE โ Filtering Data:
WHERE filters rows based on conditions.
Result:
What you observe: Only rows meeting the condition (salary > 50000) are shown
Analyst interpretation: Filtering removes irrelevant data, focusing analysis on meaningful subsets
4. Common Conditions in WHERE:
๐น Comparison Operators:
Result:
What you observe: Data changes based on conditions like >, <, =
Analyst interpretation: Enables precise filtering based on business rules
๐น Multiple Conditions(AND, OR):
Result:
What you observe: Data is filtered using combined conditions
Analyst interpretation: Helps answer complex business questions by applying multiple criteria
๐น Range Filtering (BETWEEN):
Result:
What you observe: Data within a specific range is returned
Analyst interpretation: Useful for time periods, salary ranges, and continuous data analysis
๐น List Filtering(IN):
Result:
What you observe: Only values matching a specific list are shown
Analyst interpretation: Simplifies filtering when dealing with multiple categories
๐น Pattern Matching(LIKE):
Result:
What you observe: Results match a pattern (e.g., names starting with โAโ)
Analyst interpretation: Useful for text-based filtering, search, and data cleaning tasks
5. Real-World Query Example:
Using the same dataset:
Result:
What you observe: A refined dataset combining multiple conditions and selections
Analyst interpretation: Real-world analysis requires combining SELECT, FROM, and WHERE to extract actionable insights
Why This Matters for Data Analysts:
- Reduces large datasets โ focused insights
- Forms the base for all advanced SQL queries
- Used in every dashboard, report, and analysis
Without this step, analysis becomes slow and inaccurate.
Previous Series:
- Series 1 & 2 โ Python Lambda (data transformation)
- Series 3 โ Statistics (decision-making)
โก๏ธ Whatโs Next โ Series 4:
SQL Fundamentals for Data Analysts
Next, we go deeper into controlling results:
- โ Part 2: Sorting & Filtering
Final Insight
Selecting data is the first step โ but selecting the right data is what makes analysis powerful.
Follow for More
Follow to master real-world data analysis step by step through the Shahnaz Insights series.
And if you found it valuable, a clap ๐ helps this reach other aspiring analysts ๐









