How to Learn SQL in Only 10 Minutes

books in black wooden book shelf

I used to hate SQL.

Too many keywords, weird syntax, and you always need some dummy table to even get started. But today, I finally sat down and said: “Alright. Lets teach myself SQL like I have 10 minutes before a demo.”

So here’s what I learned — written the way I wish someone told me earlier.

SQL is Just Talking to Tables
You can think of it like this:
Every SQL command is like telling a robot how to look at a spreadsheet.

Tables = spreadsheets.
Rows = data entries.
Columns = fields.

Simple.

Step 1: SELECT — Get Me the Data

SELECT * FROM users;

Get everything from the users table.

Want just names?

SELECT name FROM users;

Step 2: WHERE — Filter It

SELECT * FROM users WHERE age > 20;

Like saying: “Show me users older than 20.”

You can even combine it:

SELECT * FROM users WHERE age > 20 AND name != 'Bob';

Step 3: INSERT — Add Data

INSERT INTO users (name, age) VALUES ('Derry', 25);

Adds a row.


Step 4: UPDATE — Change Data

UPDATE users SET age = 26 WHERE name = 'Derry';

Modify a row. Only works if you filter with WHERE.


Step 5: DELETE — Remove Data

DELETE FROM users WHERE name = 'Derry';

Yup. Gone.


Step 6: CREATE TABLE — Make a Table

CREATE TABLE users (
  id INT,
  name TEXT,
  age INT
);

Also: if you screw up…

DROP TABLE users;

Wipes the table.


Step 7: JOIN — Mix Two Tables Together

Let’s say:

  • users table: has names and ids
  • orders table: has items and user_ids
SELECT users.name, orders.item
FROM users
JOIN orders ON users.id = orders.user_id;

Boom. You get people and what they ordered.


Step 8: GROUP BY + COUNT

Count how many orders per user:

SELECT user_id, COUNT(*) AS total_orders
FROM orders
GROUP BY user_id;

Super useful for summaries.

Other similar tricks:

  • SUM() = total value
  • AVG() = average
  • MIN() / MAX() = lowest/highest

Step 9: LIKE, IN, BETWEEN

SELECT * FROM users WHERE name LIKE 'A%';  -- starts with A
SELECT * FROM users WHERE age BETWEEN 20 AND 30;
SELECT * FROM users WHERE name IN ('Alice', 'Charlie');

Flexible filters. Feels kinda like regex, but friendlier.


Step 10: NULL — It’s… Nothing

SELECT * FROM users WHERE email IS NULL;

Use IS NULL and IS NOT NULL.
Don’t use = NULL. It won’t work.


Extra Power: Subqueries

SELECT * FROM users
WHERE id IN (SELECT user_id FROM orders);

Yes. SQL can be meta.


Bonus: Try This in Python (with SQLite)

import sqlite3
conn = sqlite3.connect(':memory:')
c = conn.cursor()

c.execute('CREATE TABLE users (id INTEGER, name TEXT, age INTEGER)')
c.execute("INSERT INTO users VALUES (1, 'Alice', 22)")
c.execute("INSERT INTO users VALUES (2, 'Bob', 30)")

c.execute("SELECT name FROM users WHERE age > 23")
print(c.fetchall())  # [('Bob',)]

TL;DR SQL Cheatsheet

SELECT * FROM users;
INSERT INTO users (name, age) VALUES ('Derry', 25);
UPDATE users SET age = 26 WHERE name = 'Derry';
DELETE FROM users WHERE name = 'Derry';
CREATE TABLE users (id INT, name TEXT, age INT);

Final Thoughts

I still don’t love SQL. But at least I get it now. It’s just talking to a spreadsheet, politely but firmly. Once you learn the verbs (SELECT, INSERT, UPDATE, DELETE), it’s just puzzle pieces.

If you’re like me, coming from Python or anything else, the biggest help was running SQL inside Python (like sqlite3) so I could test fast without setting up Postgres or MySQL.

Hope this helps ya! 😉


Leave a Reply

Your email address will not be published. Required fields are marked *