Delete a post → comments go with it
On a blog, an author deletes their post — its comments should go with it, otherwise the database holds «orphan» comments pointing at a missing post.
Build two tables: posts with id (primary key) and title (up to 200 chars), and comments with id (primary key), body (text), and a required reference post_id to posts(id). Configure the reference so that deleting a post also deletes its related comments automatically.
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