AI-ENGINEERING
    beginner

    Data Schema

    AI Engineer path · lesson 66 of 124
    The idea
    A schema is the blank form with rules printed on it: this box takes a number, this one a valid email, this one only 'admin/user/guest'. Fill it wrong and it's rejected at the door.
    How to use
    Break a field value and watch validation fail instantly — then switch encodings to see the same rules in SQL, JSON Schema, Pydantic, and Protobuf.
    Record is valid against the schema
    integer, required
    string, format: email
    integer, minimum: 0
    enum: admin | user | guest

    Key insight

    A schema is the data contract — each field’s type and constraints. Enter a bad value and validation rejects it on the spot. This is the same machinery that makes an LLM’s structured output trustworthy.

    Fact or dimension?

    Sort

    Sort each table into its place in a star schema.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Fact table

    Drop items here

    Dimension table

    Drop items here
    6 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    What does a schema constraint like CHECK (age >= 0) provide?

    The short version

    A schema is the blank form with rules printed on it: this box takes a number, this one a valid email, this one only "admin/user/guest". Fill it wrong and it's rejected at the door.

    In more depth

    Data Schema

    A schema declares the shape of data — field names, types, and constraints (required, ranges, enums, formats). It's the contract every producer and consumer agrees on, expressible as SQL DDL, JSON Schema, Protobuf, or a Pydantic model.

    Schema-on-write validates before storing (strong, rigid); schema-on-read validates at query time (flexible, late errors). In AI systems, a schema is also what lets an LLM emit structured outputs and tool arguments the rest of the pipeline can trust.

    Interview Questions

    Amazon
    Snowflake
    Databricks
    Meta
    OpenAI
    Anthropic
    Databricks
    Databricks
    Snowflake
    OpenAI
    Anthropic

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required