Create a Books Table with a Required Author Reference
You're designing a simplified bookstore database where every book must be associated with an author. Create a table named authors with two columns: id as the primary key and name as a required string of up to 100 characters. Then create a table named books with id as the primary key, title as a required string of up to 200 characters, and a required author_id that references authors(id). This relationship must prevent books from being added without an existing author.
Solution requirement
Just CREATE/ALTER/DROP — no trailing SELECT needed.