Video summary
Learn Basic SQL in 15 Minutes | Business Intelligence For Beginners | SQL Tutorial For Beginners 1/3
Main summary
Key takeaways
Main Ideas / Lessons
-
SQL is essential for BI work even with modern BI tools
- BI tools can generate SQL automatically for simple chart/report queries (drag-and-drop interfaces).
- But you often must write SQL yourself to:
- pre-aggregate
- filter
- select only the data needed
- typically via views
- Views improve performance by reducing large tables (e.g., millions of rows) to smaller, query-ready datasets (e.g., thousands of rows).
-
This tutorial teaches core SQL query concepts quickly (15 minutes)
- Focus is on SELECT queries (retrieving data), not creating/deleting databases or tables.
-
Hands-on setup
- Uses an SQLite database containing EA Sports FIFA football statistics.
- Uses Navicat as the SQL client to connect/query the database (Navicat premium mentioned).
Methodology / Instruction-Style Content (Detailed)
1) Basic Querying with SELECT
-
Return the entire table:
sql SELECT * FROM player; -
Return only specific columns:
sql SELECT player_name, birthday FROM player; -
SQL is case-insensitive for keywords (lowercase or uppercase both work), but you can beautify for readability (e.g.,
SELECT,FROMin uppercase).
2) Renaming Output Columns with Aliases
-
Simple alias:
sql SELECT player_name AS name FROM player; -
Alias containing spaces (use quotes):
sql SELECT player_name AS 'Full name' FROM player;
3) Filtering Rows with WHERE (and Key Operators)
-
Equality (numeric)
- Example concept: return players with weight exactly
190.
- Example concept: return players with weight exactly
-
Comparison (numeric)
- Example concept: weight
>= 190.
- Example concept: weight
-
Multiple conditions
AND: both conditions must be true- Example concept:
weight > 190 AND height > 190
- Example concept:
OR: either condition can be true- Example concept is described similarly.
-
Text matching
-
Exact match:
sql player_name = 'Aaron Galindo' -
Alternative exact matching using
LIKE(described as achieving the same goal).
-
-
Pattern matching with
LIKE- Starts with text:
%at the end'Aaron%'→ “Aaron…”
- Ends with text:
%at the beginning'%Aaron'→ “…Aaron”
- Contains text:
%on both sides'%Aaron%'→ “…Aaron…”
- Single-character wildcard:
_represents one character- Example:
T_M%means:- starts with
T, then one character, thenM, then anything after
- starts with
- Starts with text:
-
IN operator for text (exact matches only)
- Replaces multiple
ORchecks for exact values - Does not support
%/_patterns - Example concept:
sql WHERE player_name IN ('Cristiano Ronaldo', 'Lionel Messi')
- Replaces multiple
-
BETWEENfor numeric ranges- Example concept:
sql WHERE weight BETWEEN 180 AND 190
- Example concept:
-
NULL handling
- Use
IS NULL/IS NOT NULL - Example concept:
- select from
matchwherehome_player_1 IS NULL(orIS NOT NULL)
- select from
- Use
4) Sorting Results with ORDER BY
-
Ascending (default):
sql ORDER BY weight -
Descending:
sql ORDER BY weight DESC -
Sorting matters less in this workflow because BI tools can sort after data retrieval.
5) Joining Data from Multiple Tables (JOIN)
-
Motivation:
- Some tables (e.g., “player attributes”) include
player_idbut not the player name. - To create a view with both name and rating, you need to combine tables.
- Some tables (e.g., “player attributes”) include
-
Approach shown:
- Select fields using
table_name.field_namenotation- e.g.,
player_attributes.player_api_id, plusplayer_attributes.date, plus rating
- e.g.,
- Attempting
player.player_namewithout joining causes an error. -
Use an INNER JOIN:
sql INNER JOIN player ON player_attributes.player_api_id = player.player_api_id -
Result: player names appear alongside attributes.
- Select fields using
-
Table aliases to simplify queries:
- Alias tables as single letters:
player_attributes AS Aplayer AS B
- Then reference fields like:
A.player_api_id,B.player_name, etc.
- This makes queries cleaner.
- Alias tables as single letters:
6) Aggregation with SUM/AVG and Grouping with GROUP BY
-
Goal:
- Combine multiple rows per player (e.g., different dates) into a single result per player.
-
Using an aggregate function:
- Example concept:
SUM(A.overall_rating)to total ratings over time (an attempt is shown)
- Example concept:
-
Why
SUMalone didn’t work:- You must define grouping.
-
Use
GROUP BY:- Include all non-aggregated fields in
GROUP BY. - The tutorial refines grouping by removing
datefrom grouping so ratings across all dates combine per player.
- Include all non-aggregated fields in
-
Output alias and ordering:
- Create a result alias, e.g.
AS rating - Sort descending aggregated rating:
ORDER BY rating DESC
- Create a result alias, e.g.
-
Sanity check / interpretation improvement:
- Ronaldo and Messi not appearing as expected after SUM.
- Possible reason: different counts of available records.
- Adds ideas:
- mentions checking with
COUNT - switches to average for better comparison:
- replace
SUMwithAVG:sql AVG(overall_rating)
- replace
- mentions checking with
7) Filtering Aggregated Results with HAVING
-
Key distinction:
WHEREfilters rows before grouping.HAVINGfilters grouped results afterGROUP BY.
-
Structure:
- Put
HAVINGafterGROUP BYand beforeORDER BY. - Example concept:
sql HAVING score > 85
- Put
-
Result:
- Reduces the output set (only 26 records mentioned).
8) Final Formatting Takeaway
- Encourage readable SQL formatting:
- Use uppercase for SQL keywords.
- Keep clean structure and layout.
- Conclusion:
- This is a small foundation, but enough to confidently learn more.
Speakers / Sources Featured
- Speaker: Adam Finer (explicitly stated near the end: “This has been Adam Finer…”)
- Source/channel: “Vitamin BI” (channel name mentioned: “Hello and welcome to Vitamin BI…”)
- Tools mentioned (not speakers): Navicat, SQLite database (football/FIFA dataset)