Title: 544
Tags: lec15

Q: What SQL clause lets you combine two tables?
A: JOIN

Q: What are two SQL clauses that let you filter down what rows are included based on some condition, and how do these two clauses differ?
A: WHERE and HAVING
WHERE is prior GROUP BY (if GROUP BY is used), so filters input rows
HAVING is after GROUP BY, so filters groups

Q: What SQL clause pulls together related rows?
A: GROUP BY

Q: In SQL, SUM, AVG, and other operations that work over all rows (or groups of rows) are called ______
A: aggregates

Q: What SQL clause sorts rows?
A: ORDER BY

Q: What SQL clause lets you limit results to the first N rows?
A: LIMIT

Q: What does ACID stand for?
A: - atomiticy: it all happens or nothing happens (partial progress is rolled back)
- consistency: application invariants (like no negative bank accounts) are supported
- isolation: others cannot see a transaction in progress (aka atomicity when talking about locks)
- durability: once finished, it persists (even if machine crashes+restarts)

Q: If conn is a SQLAlchemy connection, and you've made some changes as part of a transaction, how do you finalize that transaction?
A: conn.commit()

Q: If conn is a SQLAlchemy connection, and you've made some changes as part of a transaction, how do you abandon that transaction?
A: conn.rollback()