#1 What is SQL?
SQL Crash Course #1
Hi everyone! Cornellius and from heređ.
As promised, we are starting our SQL Crash Course, which will take you from zero to hero!đ
As a reminder, we will cover seven SQL key topics, each separated into multiple posts across
and .The first topic we will learn together is the Introduction â What SQL is and why it matters. This topic will consist of three courses, including:
đWhat is SQL?
đWhy learn SQL
đRelational Data & Relational Models
In this post, I will post about what is SQL, and
will teach you all about why you need to learn SQL in the different posts!Without further ado, letâs get into our first course! The million dollar question isâŠ
âWhat Is SQL?â
Look, I am sure you guys have heard SQL in some ways or might have used it previously.
However, have you ever sat down and just really asked the question above?
Letâs trace back a little bit to why SQL was born.
Picture this: You order a matcha latte through an app. You binge-watch a show Netflix swears youâll love. You scroll Instagram, double-tapping posts that feel eerily tailored to your mood.
What do these moments have in common?
Data.
Every click, swipe, and search you make adds to a tsunami of informationâ2.5 quintillion bytes generated dailyđ€Ż. Businesses thrive on it, and governments depend on it. Even your favorite apps use it to predict your next move.
But hereâs the catch: raw data is chaos. Itâs a resource full of unanswered questions, hidden trends, and opportunities.
To utilize the data, you need a translatorâa universal language that turns âWhat do we know?â into âWhat should we do next?â
Here comes the SQL (Structured Query Language) as our translator.
đ€So, What is SQL Exactly?
Think of SQL as the Google Translate for data. Itâs how marketers decode customer habits, how hospitals track vaccine rollouts, and how Spotify actually knows youâd love that indie folk playlist.
Itâs not just for programmersâSQL for anyone curious enough to ask, âWhatâs the story behind these numbers?â SQL acts as an intermediary, translating our requests into meaningful data and providing the insights we seek.
âA 50-Year-Old Language Thatâs Still Everywhere
Born in 1974, SQL is older than the internet itself. Yet, itâs still the gold standard for databasesâpowering everything from your bankâs transaction records to NASAâs Mars rover missions. Why? Because it just works.
SQL's logic stays the same whether youâre querying 100 rows or 100 million. Thatâs why your Spotify Wrapped playlist feels so good, and Amazon knows youâll need dog food by Tuesday.
Well, enough fancy words. Letâs discuss what SQL is in the core.
đThe Core of SQL
At its core, SQL is a way to talk to databases. It lets you:
Ask questions: âWhat products are under $20?â
Update records: âAdd 50 points to Sarahâs loyalty account.â
Spot patterns: âWhich customers buy pumpkin spice lattes in July?â
And hereâs the best part: SQL looks almost like English. For example, hereâs how a cafĂ© owner might find all affordable pastries in their inventory:
SELECT item_name, price
FROM menu
WHERE category = 'pastries'
AND price < 5; Translation: âShow me the names and prices of pastries costing less than $5.â
Pretty easy, right?đ
SQL isnât targeted only for developers or techiesâitâs for anyone who wants to use data. Even if youâve never written a line of code, SQL is much more straightforward than other programming languages.
You can easily learn it if you put your mind into it! (And by following this courseđ)
đ§©Component of SQL
The language relies on a few intertwined components for SQL to work properly. Here are the essential SQL Components that make it work properly.
#1. Tables
Tables are the backbone of any database that relies on SQL. You can think of a table as a spreadsheet with rows and columns.
Each table usually represents a specific entity (e.g., users, products, transactions) and is the source of meaningful information.
#2. Statement Commands
SQL Statements Commands mainly instruct databases on what to do with our data in the Tables. They typically fall into three categories:
DDL (Data Definition Language): Defines the database structure (e.g., creating, altering, or dropping tables and indexes).
Commands:
CREATE TABLE,ALTER,DROPExample:
CREATE TABLE Users (id INT, name VARCHAR(100));
DML (Data Manipulation Language): Manages data within the tables by inserting, updating, deleting, or retrieving records.
Commands:
SELECT,INSERT,UPDATE,DELETEExample:
INSERT INTO Users (id, name) VALUES (1, 'Alice');
DCL (Data Control Language): Controls permissions and access to the data.
Commands:
GRANT,REVOKEExample
GRANT SELECT ON Users TO analyst;
Think of these statements as the database's instruction command. However, they still lack precision, which is why we have the queries.
#3. Queries
Queries are how we use SQL to retrieve and manipulate data according to specific needs.
The Statement Commands were refined and structured to acquire data from tables into meaningful insights or results. For example, here is how the website owner is able to get the userâs total signup:
SELECT name, COUNT(*) FROM Users WHERE signup_date > '2024-01-01' GROUP BY name;Think of queries as how you âtalkâ to the database but with the grammar you must put together correctly.
#4. Stored Procedures
Stored procedures are pre-written SQL scripts saved in the database. They act like shortcuts for repetitive SQL query tasks, such as a stock metrics aggregation.
CREATE PROCEDURE AggregateStockMetrics(
IN p_StartDate DATE,
IN p_EndDate DATE
)
BEGIN
SELECT
COUNT(*) AS TradingDays,
AVG(Close) AS AvgClose,
MIN(Low) AS MinLow,
MAX(High) AS MaxHigh,
SUM(Volume) AS TotalVolume
FROM stock_data
WHERE
(p_StartDate IS NULL OR Date >= p_StartDate)
AND (p_EndDate IS NULL OR Date <= p_EndDate);
ENDInstead of writing a query from scratch for every task, we only need to call the procedure and pass the parameters to acquire necessary data.
CALL AggregateStockMetrics('2015-01-01', '2015-12-31');Thatâs all the SQL components you need to know. I know itâs just scratching the surface, but itâs exactly why this course exists!
How to Get Started đ
Over the coming weeks, weâll guide you through:
â
SQL Fundamentals
â
Intermediate SQL
â
Advanced SQL
â
Database Operations
â
Writing Efficient Queries
Whatâs Next?âĄïž
This is the first of many posts about the upcoming SQL Courses. It will only explain what SQL is in its crude form.
To get the full experience and fully immersed in the learning:
đSubscribe to Databites.tech (By Josep)
đSubscribe to Non-Brand Data (By Cornellius)
đCheck out the SQL Crash Course GitHub repo
đShare with your friend and whoever needs it!
đïž Every Thursday, you will have two new issues in your inbox!
Letâs dive in and make SQL less scary, more fun, and way more useful! đ
Josep & Cornellius





