0
0
SQLquery~10 mins

SELECT all columns in SQL - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - SELECT all columns
Start Query
Parse SELECT *
Identify Table
Retrieve All Columns
Return All Rows with All Columns
End Query
The query starts by reading SELECT * which means all columns from the specified table are retrieved and returned.
Execution Sample
SQL
SELECT * FROM employees;
This query retrieves every column and every row from the employees table.
Execution Table
StepActionEvaluationResult
1Parse querySELECT * FROM employeesReady to execute
2Identify tableemployeesTable found with columns: id, name, role, salary
3Retrieve columns* means all columnsColumns selected: id, name, role, salary
4Fetch rowsAll rows from employeesRows fetched: 3
5Return resultAll columns and rowsResult set with 3 rows and 4 columns
6End queryQuery completeExecution finished
💡 All rows and all columns retrieved, query execution ends.
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4Final
tableundefinedemployeesemployeesemployeesemployees
columnsundefinedundefinedid, name, role, salaryid, name, role, salaryid, name, role, salary
rowsundefinedundefinedundefined3 rows fetched3 rows fetched
result_setundefinedundefinedundefinedundefined3 rows x 4 columns
Key Moments - 2 Insights
Why does SELECT * return all columns instead of just one?
SELECT * is a shortcut that tells the database to include every column from the table, as shown in execution_table step 3 where all columns are selected.
Does SELECT * limit the number of rows returned?
No, SELECT * returns all rows by default unless a WHERE clause is added. Execution_table step 4 shows all rows are fetched.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what columns are selected at step 3?
ANo columns selected yet
Bid, name, role, salary
COnly id and name
DOnly salary
💡 Hint
Check the 'Retrieve columns' action in execution_table step 3.
At which step does the query fetch all rows from the table?
AStep 2
BStep 3
CStep 4
DStep 5
💡 Hint
Look for 'Fetch rows' action in execution_table.
If the table had 5 columns instead of 4, how would the result set change?
AIt would return 5 columns
BIt would still return 4 columns
CIt would return only 1 column
DIt would return no columns
💡 Hint
SELECT * means all columns, so adding columns increases the count in result_set.
Concept Snapshot
SELECT * syntax:
SELECT * FROM table_name;

- '*' means all columns
- Returns all rows by default
- Useful to quickly get full table data
- Can be combined with WHERE to filter rows
Full Transcript
This visual execution shows how the SQL query SELECT * FROM employees works step-by-step. First, the query is parsed and the employees table is identified. Then, the * symbol tells the database to select all columns from the table. Next, all rows are fetched from employees. Finally, the full result set with all columns and rows is returned. This helps beginners see how SELECT * retrieves complete data from a table.