Skip to content

Relational Databases & Supabase

What are we trying to accomplish?

The goal of these two lectures, Relational Databases and Databases on the Cloud, is to equip students with the knowledge and practical skills necessary to transform an application's user stories into a well-structured, cloud-hosted relational database that Claude Code can help build and that students can confidently supervise. Students will first learn what a Relational Database Management System (RDBMS) is and how to think about data by extracting tables from the nouns in their user stories, listing the attributes that become columns, choosing accurate PostgreSQL data types, and connecting tables through primary keys, foreign keys, and one-to-one, many-to-one, and many-to-many relationships, all visualized as diagrams in DrawSQL. They will then bring those designs to life by learning how Supabase, a Backend as a Service platform built on PostgreSQL, provides a cloud-hosted database, visual dashboard, and auto-generated APIs, and by connecting a Supabase project to Claude Code through MCP. By the end of these lectures, students should be capable of independently planning a data model, handing Claude Code their user stories, DrawSQL diagram, and SQL schema as clear instructions, and verifying each change one step at a time in the Supabase dashboard, establishing the foundation for connecting their front-end applications to real data through CRUD operations.

Lectures and Assignments

Lectures

Assignments

TLO's (Terminal Learning Objectives)

  • Design a relational data model from user stories using DrawSQL
  • Identify the tables, columns, data types, and relationships an application needs
  • Create a Supabase project and connect it to Claude Code through MCP
  • Direct Claude Code to build and verify a database schema in Supabase using user stories, a diagram, and a SQL schema

ELO's (Enabling Learning Objectives)

  • Define a Relational Database Management System and explain tables, rows, columns, and SQL
  • Extract tables and columns from the nouns and attributes in user stories
  • Choose appropriate PostgreSQL data types such as UUID, VARCHAR, BOOLEAN, TIMESTAMPTZ, and DECIMAL
  • Distinguish primary keys from foreign keys
  • Choose between one-to-one, many-to-one, and many-to-many relationships, and use junction tables when needed
  • Explain what Supabase and PostgreSQL are and why Supabase suits agentic workflows
  • Authenticate Claude Code with a Supabase project via /mcp
  • Apply a pause-and-verify approach when Claude Code makes database changes