Study Notes

SQL Guide

Structured notes from my Oracle 19c SQL workshop study pass. Same site aesthetic, less context switching, and no hunting through filenames at midnight.

22 chapters oracle + mysql markdown-backed

01
01 - Course Introduction
And look, when someone says “course objectives” your brain usually leaves the room. But this introduction actually matters, because it tells you what kind of power you’r...
Open chapter →
02
02 - Retrieving Data Using the SQL SELECT Statement
And look, the SELECT statement is the thing you thought SQL was: “show me stuff from a table.” But it also hides a surprising number of ways to confuse yourself with ali...
Open chapter →
03
03 - Restricting and Sorting Data
And look, a SELECT that returns every row in a table is technically correct, but it’s also the database equivalent of shouting “EVERYBODY IN HERE” and being surprised wh...
Open chapter →
04
04 - Using Single-Row Functions to Customize Output
And look, raw table data is honest, but it’s also aggressively unhelpful. Sometimes you want names capitalized nicely, salaries rounded, dates massaged into something re...
Open chapter →
05
05 - Using Conversion Functions and Conditional Expressions
And look, databases are pedantic. They care deeply about whether something is a number, a string, a date, or now even JSON, and they will absolutely throw an error if yo...
Open chapter →
06
06 - Reporting Aggregated Data Using Group Functions
And look, at some point “one row per employee” stops cutting it. HR doesn’t want every salary; they want average salary by department, or total pay for sales reps, or “h...
Open chapter →
07
07 - Displaying Data from Multiple Tables Using Joins
And look, normalized databases are great for design and terrible for reporting. All the interesting information is split across five different tables—employees here, dep...
Open chapter →
08
08 - Using Subqueries to Solve Queries
And look, sometimes your WHERE clause doesn’t know enough to do its job. You want “everyone hired after Davies”, but you don’t actually know when Davies was hired. You c...
Open chapter →
09
09 - Using Set Operators
And look, sometimes one query is not the problem—the problem is that you have two (or more) queries and HR wants “everything from both, but without duplicates, except wh...
Open chapter →
10A
10A - Managing Tables Using DML Statements in Oracle
And look, reading data is safe. It’s like browsing a store: you can stare at products all day and nothing changes. DML is when you start rearranging shelves, throwing th...
Open chapter →
10B
10B - Managing Tables Using DML Statements in MySQL
And look, reading from a MySQL database is harmless. Writing to it is where lawyers and auditors start to pay attention. When you INSERT, UPDATE, or DELETE, you’re chang...
Open chapter →
11A
11A - Introduction to Data Definition Language in Oracle
And look, all the querying, joining, and updating in the world doesn’t help if the tables themselves are wrong—missing columns, bad data types, or no constraints so peop...
Open chapter →
11B
11B - Introduction to Data Definition Language in MySQL
And look, you can write the world’s fanciest queries, but if your tables are mis‑shapen nightmares—with missing columns, wrong types, and no constraints—your database is...
Open chapter →
12
12 - Introduction to Data Dictionary Views
And look, your schema knows things about itself that you have absolutely no idea about: who created which table, what constraints lurk on which columns, and why that one...
Open chapter →
13
13 - Creating Sequences, Synonyms, and Indexes
And look, your tables are lovely, but on their own they’re a bit slow, slightly inconvenient, and prone to “who assigned this ID twice?” disasters. This is where sequenc...
Open chapter →
14
14 - Creating Views
And look, sometimes you want people to see some of a table, but not all of it. Or you’re tired of rewriting the same five‑table join every time you need a report. This i...
Open chapter →
15
15 - Managing Schema Objects
And look, once your database has been alive for more than about five minutes, people start saying things like “we just need one tiny schema change,” which is how you end...
Open chapter →
16
16 - Retrieving Data by Using Subqueries
And look, plain single‑table queries are fine… if your data model was designed by a golden retriever. For actual systems, you’re going to need subqueries talking to othe...
Open chapter →
17
17 - Manipulating Data by Using Subqueries
And look, selecting with subqueries is all very nice, but at some point someone will say, “Can we actually change the data based on that logic?” This is where we stop ju...
Open chapter →
18
18 - Controlling User Access
Welcome to the glamorous world of database security, where your dreams of unlimited power go to die under the watchful eye of the DBA.
Open chapter →
19
19 - Manipulating Data Using Advanced Queries
And look, basic INSERT, UPDATE, and DELETE are cute. They’re the training wheels of SQL. But at some point you stop gently adding rows and start doing things like loadin...
Open chapter →
20
20 - Managing Data in Different Time Zones
And look, storing dates without time zones is like scheduling a global meeting and only writing “9 AM” in the invite. Whose 9 AM? Where? On which planet? This lesson is...
Open chapter →