Session 6 of 29. Two topics, about 45 minutes of talking between them — roughly
25 on schema and 20 on tokens — and the rest of the period is team work. Teams
should leave with a schema drawn. This is not a database course: it is exactly
enough relational modelling to design a small schema, plus the one access rule
that is not optional, and then the constraint that governs how the building
itself gets paid for. Tokens sit here rather than a week later on purpose —
Phase 2 asks for a token plan at the end of week 4, and a plan taught two days
before it is graded is not a plan.
Say the boundary out loud on both halves. Some students have had a database
course and will want normal forms; some have had nothing — the scope is set by
what the project needs, and the optional reading covers normalisation. The
second half is conceptual on purpose: it is about how to think about a
constraint, not about arithmetic.
Go slowly. For a good part of the room this is genuinely the first time, and
every later idea sits on these three. Use a table from a project in the room
rather than an abstract example.
Point at each part as you name it. Note that every column holds one fact and
none of them holds a list — that is the observation the repeating-groups slide
depends on, so plant it here.
The practical framing is what sticks: a key is how you point at a row. Names are
not keys — two customers share a name, and one customer changes theirs.
Demystify it. Students expect something structural and it is a column with a
rule attached. Draw the arrow between the two tables on the board once.
Resist teaching many-to-many today. If a team genuinely needs it, it is a
five-minute conversation at their table, and every minute spent on it in the
room is a minute not spent drawing their own schema.
This is the rule that prevents the most common failure, and it is short enough
to remember. Say it, then show the failure on the next slide.
Work one live example from bad to good on the board — take a real table from a
team in the room. The two questions in the left card are what make it land:
a fourth item, and searching. Neither has an answer in the wrong version.
This is why the topic sits here rather than later. Every story a team writes
touches the data, so a schema decided badly in week 3 is paid for in week 9.
Screens can be rebuilt in an afternoon; a wrong table with three weeks of rows
in it cannot.
Say "only" with weight. Students who notice the key in the page assume a
mistake has been made and either panic or ignore it. Neither is right, and the
next slide is the reason.
The single most important sentence of the week and the most important reading of
the week. RLS is what makes a public key safe: the key gets you to the door,
the policy decides which rows you may see.
Three bullets, delivered flatly, no drama. The note is what makes it real for a
team that has a live client. Let it sit for a moment before moving on.
This connects straight back to verification: the agent optimises for the thing
you asked for, and you did not ask for a policy. It is the clearest example in
the course of why owning what you ship is a practical rule and not a slogan.
Both halves matter and the prompt half is the one they have not considered. A
client's customer list pasted into a chat window has left the building. Seeding
fake data is also simply faster, which is the argument that actually works.
Keep this conceptual and short. Nobody needs to compute a token count; they need
the mental model that reading is not free, because that is the one that changes
how they prompt.
This is the framing the whole half-hour exists to install. Do not moralise; it
lands better as a flat statement about how engineering works than as a warning.
This surprises everyone, so say it twice and let the room argue. The intuition
students bring is per-message pricing from consumer chat apps, and it is wrong
here in the direction that costs them a delivery.
Say the second card plainly. Students will otherwise hunt for a counter that does
not exist and conclude they have missed a setting. It also explains why nothing
in this course ever asks them for a Gemini Enterprise usage figure.
Connect it back rather than presenting it as new. They were told plan in the
browser, build in the IDE on day two; this is why that split is also the
cheapest way to work.
This is the one slide with concrete tactics on it, and it is the one to slow
down for. Ask the room for a prompt they sent this week and narrow it together.
Walk down the ladder in order. Most teams reach for rung three first and skip
the two rungs that cost nothing. Rung four is also the honest answer to why the
version-control and hand-editing skills in week 2 were not optional.
Frame the personal key as insurance, not homework. The teams that skip it are the
teams that discover the quota is gone the night before a delivery, at which
point setting up a key is the last thing they want to be doing.
Point at the checklist rather than reciting a schema-shaped version of it — the
full list is on the course site and is walked in the last lecture. What today
delivers is the schema and access-rules line on it. Teams should leave this room
with a draft on paper: three or four tables is a normal size, and a team that has
drawn ten has almost certainly misunderstood the scope.
Five lines, and each one is answerable in a sentence. Teams inflate this into an
essay if it is left vague. The fourth line is the one that separates a plan from
a wish: it forces them to say out loud that the browser tool shows them nothing.
Two readings only, and both are first-party documentation for the tool they are
actually using. Tell them to read Tables and Data first even though RLS matters
more — the policies do not make sense without the tables.
Both are short. The Models page is worth opening in front of them for ten
seconds so they know where the limit indicator lives before they need it.
Close on the three. Any team that has not drawn a schema by the end of today's
team time should say so before leaving — that is the blocker, and it does not
improve by being left alone. The plan is the shortest of the three and the one
teams will leave until last.