Jean Lee @Exaltitude Newsletter

Jean Lee @Exaltitude Newsletter

SQL CHEATSHEET

Jean Lee's avatar
Jean Lee
Feb 03, 2026
āˆ™ Paid

šŸ‘‹ Hi, I’m Jean,

I’m the Founder of Exaltitude, a platform built to help software engineers grow, get recognized, and stay relevant—especially in a rapidly changing tech landscape.

With 20+ years of experience in Silicon Valley, I’ve worked at both startups and giants, including being the 19th engineer at WhatsApp and later leading teams at Meta after the $19B acquisition. Over the years, I’ve interviewed hundreds of engineers and mentored even more—helping them land jobs, level up, and thrive.

I’ve created this SQL Cheatsheet to simplify the learning process for you, whether you’re prepping for interviews, working with data, or just getting started. It’s clean, concise, and practical—just like I wish I had when I was learning.

šŸ“Œ If you’re not already connected with me:

  • Follow me on LinkedIn for career advice and AI news

  • Subscribe to YouTube for tutorials, explainers, and tech strategy

  • Check out exaltitude.io for many free guides and resources

Let’s build your future, one skill at a time!

Jean Lee

Outline

  • Definitions

  • Querying Data

  • Joining Tables

  • Grouping & Aggregation

  • Table & Data Management

Definitions

SQL: Structured Query Language for accessing and manipulating databases.

DDL: Data Definition Language – create/modify table structures (CREATE, DROP, etc.).

DML: Data Manipulation Language – manage data (SELECT, INSERT, UPDATE, DELETE).

DCL: Data Control Language – control access (GRANT, REVOKE).

Database: A collection of data organized for easy access, management, and updating.

Data: Raw facts or information stored in a database, typically in rows and columns.

Table: A collection of data organized in rows and columns.

Row: A single record in a table, representing a data entry.

Column: A field in a table that defines a specific type of data (e.g., name, age).

Primary Key: Uniquely identifies each row in a table.

Foreign Key: A key used to link two tables. It references the primary key in another table.

Schema: Structure of a database (tables, views, relationships, etc.).

Index: Improves query performance on specific columns by speeding up lookups.

View: A virtual table based on a saved SELECT query, often used to simplify complex joins or filters.

Query: A request to retrieve or manipulate data in a database, usually written in SQL.

Querying Data

SELECT
Retrieves specific columns of data from a table.
SELECT name, age FROM users;
Returns the name and age columns from the ā€œusersā€ table.

WHERE
Filters rows based on a specified condition.
SELECT * FROM orders WHERE status = ā€˜shipped’;
Only returns orders where the status is ā€œshippedā€.

ORDER BY
Sorts the result set by one or more columns.
SELECT name FROM employees ORDER BY hire_date DESC;
Lists employees sorted by newest hire date first.

AND / OR
Combines multiple conditions in a WHERE clause.
SELECT * FROM products WHERE price > 50 AND stock > 0;
Finds products that are over $50 and in stock.

NULL
Represents missing or undefined values.
SELECT * FROM customers WHERE phone IS NULL;
Returns customers with no phone number listed.

DISTINCT
Removes duplicate values from the result.
SELECT DISTINCT country FROM customers;
Lists each country once, even if repeated in the table.

BETWEEN
Filters results within an inclusive range.
SELECT * FROM sales WHERE amount BETWEEN 100 AND 500;
Finds sales with amounts between 100 and 500.

LIKE
Searches for a pattern in a column using wildcards.
SELECT * FROM users WHERE email LIKE ā€˜%@gmail.com’;
Finds users with Gmail addresses.

IN
Matches a column’s value against a list.
SELECT * FROM employees WHERE department IN (’HR’, ā€˜Finance’);
Returns employees in either HR or Finance.

ALIAS
Renames a column or table for readability.
SELECT name AS employee_name FROM staff;
Renames the output column to ā€œemployee_nameā€.

Joining Tables

User's avatar

Continue reading this post for free, courtesy of Jean Lee.

Or purchase a paid subscription.
Ā© 2026 Exaltitude Ā· Privacy āˆ™ Terms āˆ™ Collection notice
Start your SubstackGet the app
Substack is the home for great culture