Data · Beginner

SQL online course

Vendor-neutral SQL: SELECT, joins, and indexes. The examples run on MySQL, PostgreSQL, and SQL Server with only small dialect tweaks.

Who it is for

Anyone who needs to ask a database a question.

You should already know

Access to any SQL engine and a sample schema.

You will be able to

  • Write SELECT statements you can explain
  • Join tables on keys
  • Know when an index helps

Lessons

  1. SELECT fundamentals Projection, filters, sorting, and LIMIT/OFFSET.
  2. Joins Inner, left, and the key-matching mistakes that duplicate rows.
  3. Indexes What an index is and when it is wasted.
  4. SQL COUNT Function Learn SQL COUNT: count rows, non-NULL and distinct values, filter counts with WHERE and HAVING, group results, count joined records, and avoid common errors.
  5. SQL Aliases: Rename Columns and Expressions in Query Results Learn how SQL aliases and the AS keyword give columns, expressions, aggregates, and tables clear temporary names in query results.
  6. SQL ALTER TABLE Statement Learn how to use SQL ALTER TABLE to add, remove, and change columns, understand dialect differences, and apply schema changes safely.
  7. SQL AND and OR Operators Learn how SQL AND and OR operators combine WHERE conditions to filter rows, including precedence, parentheses, NULL handling, and practical examples.
  8. SQL AVG() Function: Calculate Average Values Learn how SQL AVG() calculates arithmetic means, handles NULL values, filters and groups rows, uses HAVING, expressions, DISTINCT, joins, subqueries, and window functions.
  9. SQL BETWEEN Operator Learn how SQL BETWEEN filters rows within an inclusive range, with numeric examples, endpoint behavior, NULL handling, and equivalent comparisons.
  10. SQL Constraints Learn how SQL constraints protect data integrity with NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, CHECK, and DEFAULT rules.
  11. SQL CREATE DATABASE Statement Learn how to use SQL CREATE DATABASE to create an empty database, understand its syntax, permissions, naming rules, and next steps.
  12. SQL CREATE TABLE Statement Learn how to use SQL CREATE TABLE to define columns, choose data types, set lengths and precision, and add constraints.
  13. SQL DELETE Statement Learn how to use SQL DELETE to remove selected rows safely, preview conditions with SELECT, use transactions, and avoid deleting an entire table accidentally.
  14. SQL DROP Statement: Remove Databases, Tables, Views, and Indexes Learn how SQL DROP removes database objects, how DROP differs from TRUNCATE, and how to handle dependencies, privileges, and dialect-specific options safely.
  15. SQL Functions: Aggregate and Scalar Functions Learn how SQL functions calculate, transform, and summarize data with practical examples of aggregate, scalar, and dialect-specific functions.
  16. SQL IN Operator Learn how to use the SQL IN operator to filter rows by matching a column against a list of text or numeric values, subqueries, and NULL-safe conditions.
  17. SQL INSERT INTO Statement Learn how to use SQL INSERT INTO to add one or more rows, map values to columns, use defaults and NULL, handle generated keys, and verify inserted data.
  18. SQL LIKE Operator: Pattern Matching with Wildcards Learn how to use SQL LIKE with % and _ wildcards for prefix, suffix, substring, and fixed-position text searches, including NULLs, escaping, and performance.
  19. SQL MIN() Function Learn how to use SQL MIN() to find the smallest non-NULL value, filter minimums with WHERE, group results with GROUP BY, and find earliest dates.
  20. SQL ORDER BY Clause: Sort Query Results Learn how to use SQL ORDER BY to sort query results by one or more columns in ascending or descending order.
  21. SQL SELECT DISTINCT Statement Learn how SQL SELECT DISTINCT removes duplicate values from query results, including single columns, column combinations, filtering, and ordering.
  22. SQL SELECT LIMIT Statement Learn how to use the SQL LIMIT clause with SELECT to return a small, controlled number of rows, with examples using employee data and ORDER BY.
  23. SQL SELECT Statement: Retrieve Data from a Table Learn how to use SQL SELECT to retrieve specific columns or every column from a table, understand result sets, and avoid common query errors.
  24. SQL SUM() Function Learn how to use SQL SUM() to total numeric values, filter rows with WHERE, group totals with GROUP BY, and filter groups with HAVING.
  25. SQL Syntax and Common SQL Commands Learn SQL statement structure and common commands for querying data, changing rows, creating tables and databases, managing indexes, and working safely.
  26. SQL UNION Operator Learn how SQL UNION and UNION ALL combine SELECT result sets, remove or preserve duplicates, sort results, use aliases, and resolve common errors.
  27. SQL UPDATE Statement Learn how to use SQL UPDATE to change existing table data, target rows with WHERE, update multiple columns, verify changes, and avoid accidental updates.
  28. SQL WHERE Clause: Filter Rows with Conditions Learn how to use the SQL WHERE clause to filter table rows with equality, comparison operators, BETWEEN, and IS NULL.
  29. SQL Wildcards and the LIKE Operator Learn how SQL LIKE patterns use % and _ wildcards for prefix, suffix, substring, and fixed-format text searches.
  30. SQL MAX() Function Learn how to use the SQL MAX() aggregate function to return the highest value in a column, with examples using a products table.
  31. What Is SQL? Structured Query Language Explained Learn what SQL is, how relational databases and RDBMSs work, common SQL statements, database products, and practical SQL examples.