DBA Foundations · Module 4

Structured Query Language (SQL)

The language every relational database speaks, from your first query to joins, changing data, creating tables, granting access, and controlling transactions. Examples run on Oracle.

Beginner 8 lessons About 52 min of reading Free
Lessons

Work through them in order.

Each lesson builds on the one before it.

  1. The SQL Language

    What SQL is, the four groups of SQL commands, how to read and write a statement, where you run SQL, and the sample tables used throughout this module.

    9 sections6 min read
  2. Querying Data with SELECT

    How to read data with SELECT: choosing columns, filtering rows with WHERE, handling NULL, sorting, and the order a query actually runs in.

    9 sections8 min read
  3. Summarizing and Joining Data

    How to total and count with aggregate functions, group rows with GROUP BY and HAVING, combine tables with joins, and nest one query inside another.

    8 sections7 min read
  4. Changing Data with DML

    How to add, change, and remove rows safely with INSERT, UPDATE, DELETE, and MERGE, and what the errors mean when the database says no.

    6 sections5 min read
  5. Defining Structure with DDL

    How to create and change tables with DDL: data types, constraints that keep bad data out, ALTER, the difference between DELETE, TRUNCATE, and DROP, and other objects.

    9 sections7 min read
  6. Constraints and Indexes

    The rules that keep bad data out: what NOT NULL means, primary, unique, and foreign keys, check constraints and defaults, and how indexes support them and speed up queries.

    10 sections9 min read
  7. Controlling Access with DCL

    How to control who can do what with GRANT and REVOKE: users, system and object privileges, roles, and checking who has access.

    9 sections5 min read
  8. Managing Transactions with TCL

    How COMMIT, ROLLBACK, and SAVEPOINT control when changes become permanent, how transactions start and end, and how locks and autocommit affect you.

    10 sections5 min read