Link a book to its author — no orphans
You're building a simplified database for a bookstore. Every book must have an author — no orphans allowed.
Build two tables: authors with id (primary key) and name, and books with id (primary key), title (up to 200 chars), and a required author_id referencing authors(id). The «required column plus parent reference» combo guarantees a book can't land in the database without an author.
Just CREATE/ALTER/DROP — no trailing SELECT needed.
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inNo starting schema
This task starts with no tables — you'll create them via CREATE TABLE.
Focus radio
Paused · SomaFM · Fluid