Databases 101
SELECT * FROM Trouble
Normal Behavior
Query and Chaos
ACID Reflux
100

A DBMS organizes data into these two-dimensional structures of rows and columns.

What are tables?

100

The keyword used to retrieve data from a table.

What is SELECT?

100

The column that uniquely identifies each row in a table.

What is a primary key?

100

Running DELETE without this clause wipes every row.

What is WHERE?

100

A group of SQL operations treated as one unit of work.

What is a transaction?

200

The term for a single horizontal entry in a table.

What is a row (record)?

200

The clause that filters rows based on a condition.

What is WHERE?

200

A column that links to the primary key of another table.

What is a foreign key?

200

The special value representing missing or unknown data (and it breaks comparisons)

What is NULL?

200

The command that permanently saves a transaction's changes.

What is COMMIT?

300

This database model organizes data into related tables and is the most widely used.

What is relational?

300

What you use to combine rows from two tables based on a related column.

What is a JOIN?

300

The overall process of organizing tables to reduce redundancy.

What is normalization?

300

A JOIN with no proper condition can blow up into this. Every row matched with every row.

What is a Cartesian product (cross join)?

300

The command that undoes changes and reverts to the prior state.

What is ROLLBACK?

400

SQL stands for?

What is Structured Query Language

400

Which clause groups rows so aggregates like COUNT run per group? A) ORDER BY B) GROUP BY C) HAVING D) WHERE

What is B) GROUP BY?

400

First Normal Form (1NF) mainly requires that: A) every table has a foreign key B) each cell holds a single (atomic) value C) there are no nulls D) all columns are indexed

What is B) each cell holds a single (atomic) value?

400

Two transactions each wait forever for the other's lock. This is a: A) rollback B) deadlock C) commit D) crash

What is B) a deadlock?

400

The "A" in ACID, all operations succeed or none do. A) Availability B) Atomicity C) Accuracy D) Authorization

What is B) atomicity?

500

Which is NOT part of "CRUD"? A) Create B) Read C) Undo D) Delete

What is C) Undo? (CRUD is Create, Read, Update, Delete)

500

To list customers from highest to lowest spending: A) ORDER BY spending ASC B) SORT BY spending C) ORDER BY spending DESC D) GROUP BY spending

What is C) ORDER BY spending DESC?

500

Daily Double: In the case study, after breaking in through SQL injection, the attackers deployed this custom web shell to steal data from MOVEit servers. 

What is LEMURLOOT?

500

A query crawls on a huge table. Most common fix? A) Add an index B) Delete the table C) Add more columns D) Rename the table

What is A) add an index?

500

Which property guarantees a committed transaction survives a power failure? A) Consistency B) Isolation C) Durability D) Atomicity

What is C) durability?