Database Course - Teacher Guide

Teaching Philosophy

This course follows a simple rule: students write 10 queries for every 1 slide you show. Theory is introduced only when students need it to solve the problem in front of them.

Here's what works: give students a broken database with duplicate IDs and missing foreign keys, have them try to insert data, watch them hit errors, then explain why constraints exist. What doesn't work: 20 minutes explaining normalization before they've seen bad data.

Course Structure

Time Distribution

Don't spend more than 20% of class time on slides. Your goal is to get to the MySQL console as fast as possible. If you're talking for 30 minutes straight, you've lost them.

Typical session breakdown: 10 min setup/intro → 15 min live demo → 5 min students try independently → review common mistakes → repeat. The lecture PDFs are reference material, not a script to follow word-by-word.

Live Coding

Never show SQL on slides when you can type it live. Make deliberate mistakes - forget a semicolon, misspell a table name, use = instead of IS NULL. Let students see you debug. They need to know errors are normal and fixable.

When students ask "how do I...", resist giving the answer immediately. Ask: "What have you tried? What error did you get? Which tables do you think you need?" Force them to think through the problem.

Common Pitfalls to Avoid

Teaching all JOIN types at once

Start with INNER JOIN only. Add LEFT JOIN when students need to find "customers who haven't ordered". RIGHT JOIN and FULL OUTER can wait until they master the first two. Too much at once creates confusion.

Explaining syntax before showing results

Students learn better when they see output first, then understand how it works. Show a complex query result, let them be impressed, then break down the syntax.

Not checking for understanding

Every 20 minutes, have students explain a concept to their neighbor or predict a query result before running it. Silence doesn't mean they understand.

Tools Setup

Lecture 1 ends with MySQL installation from ZIP distribution (no installer). Students initialize with mysqld --initialize-insecure and connect via command line before installing DBeaver. This ensures everyone can run MySQL even if DBeaver has issues.

If students struggle with installation, pair them up - one who got it working helps one who didn't. Saves you from debugging 20 individual setups.

Assessment

Skip formal exams. Watch students during exercises: Can they write a 3-table JOIN without help? Do they check with SELECT before UPDATE? Can they explain their query to a classmate? That tells you more than a written test.

By Lecture 5, students should explore Northwind database independently. If they're still asking "which table do I use?", they need more practice with Lectures 2-3.

When Students Get Stuck

Most errors are: wrong table names, missing JOIN conditions, = instead of LIKE, forgetting quotes around strings, or using WHERE with aggregate functions instead of HAVING.

Before helping, have them read the error message out loud. "Column 'customer_id' is ambiguous" usually solves itself when they say it.

Adjusting to Your Class

Fast class finishing early? Add the bonus challenges from each lecture guide. Slow class struggling? Cut the advanced sections and focus on mastery of basics. Better they nail SELECT/JOIN/GROUP BY than poorly understand window functions.

If more than 3 students have the same error, stop everyone and address it as a group. Don't debug the same issue 10 times individually.

Resources

Students benefit from:

For you: MySQL documentation, Use The Index Luke for performance tips, and the answer HTML files in the answers/ folder which show complete solutions.