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.
Work through them in order.
Each lesson builds on the one before it.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.