A database schema is the formal blueprint of a database: it names the tables, the columns in each table, the data type each column holds, and the rules that govern what values are allowed and how tables relate to one another. In this topic you move from the logical data model you produced earlier in the course to actual SQL statements — CREATE DATABASE to establish the container, and CREATE TABLE to define each entity as a physical table. This is SQL's Data Definition Language (DDL) side, distinct from the SELECT-oriented querying work you have done before.
Much of the care in schema creation goes into the details: choosing a data type that matches the real nature of the data (integers, decimals, fixed- and variable-length text, dates), declaring a PRIMARY KEY so every row is uniquely identifiable, declaring FOREIGN KEY references so related tables stay consistent, and adding column-level constraints such as NOT NULL, UNIQUE, DEFAULT, and CHECK to encode business rules directly in the schema. Constraints matter because they push rule enforcement into the database itself rather than relying on every application that touches the data.
As you watch the videos below, keep a few questions in mind. Which clause establishes identity (primary key) versus which clause establishes a relationship (foreign key)? What happens when you try to insert or delete a row that would break a reference? And how does the order in which you create tables matter when one table refers to another? Note that SQL syntax varies slightly across database products, so compare what you see on screen with the syntax used in your course environment.
This tutorial walks through the core building blocks of a table definition: SQL data types, primary keys, foreign keys, and constraints, as the title indicates. Expect an overview of common type categories and how key and constraint clauses are written inside a CREATE TABLE statement. It is part of a larger SQL full-course playlist, so it is pitched at learners building up DDL skills step by step.
It is the closest single match to the breadth of this topic, touching data type selection, primary keys, foreign keys, and column-level constraints in one short session, which helps you see how these pieces fit together in a single table definition.
A short, practical demonstration from CockroachDB on writing CREATE TABLE statements that include foreign key clauses. Based on the title and description, it focuses on the mechanics of declaring a reference from a child table to a parent table and on maintaining referential integrity as tables are created.
It gives you hands-on syntax for the CREATE TABLE and foreign key subtopics, and it comes from a database vendor's own educational channel, so the SQL shown reflects real product usage.
This video explains what a foreign key constraint is, why referential integrity matters, and how foreign keys differ from primary keys. It is conceptual rather than syntax-heavy, aimed at clarifying the role each kind of key plays in linking tables.
It supplies the conceptual grounding behind the syntax in the other two videos, directly supporting the subtopics on defining primary keys and establishing foreign keys and relationships.
Together these videos reinforce the DDL half of SQL that MO1 asks you to distinguish from querying, and they supply the concrete syntax you need for MO3 when turning a logical model into CREATE TABLE statements. The CockroachDB pair addresses MO4 most directly by explaining and then demonstrating primary key and foreign key constraints and the referential integrity they enforce, while the Rishabh Mishra tutorial adds data type selection and other column-level constraints. Use them alongside the module readings for MO2 and MO5, which treat the logical model as a blueprint and connect each design phase to its SQL implementation activity; the videos illustrate the implementation step rather than the full design workflow.
These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.