Week 2: Joins and Aggregation
Due: Wednesday, Sep 2nd
Tuesday's class introduces the relational model and simple queries. This reading gets you ready to write joins and grouped queries on Thursday, and it is the foundation of HW1.
Prompt
Paste the standard prompt, then paste this block.
Topic: Expressions, joins, and aggregation in SQL.
My learning objectives:
- Use expressions and functions in a SELECT clause.
- Write a query that joins two tables, and predict how many rows
the query returns.
- Summarize groups of rows using GROUP BY and aggregate functions.
Quiz me on these objectives. Give me one short problem at a
time and wait for my answer, and don't explain anything unless
I get it wrong or ask you to.
Sources
Each of these sections has live examples you can run and edit in the browser. Run them. Reading a query and writing a query are different skills, and only one of them is on the exam.
If Tuesday's class went by quickly, 1.2 Data retrieval covers the basics of SELECT and is worth reading first.