Using MySQL CLI and Workbench to Manage a Simple Database
📖 Scenario: You are helping a small bookstore keep track of their books and authors using MySQL. You will use both the MySQL Command Line Interface (CLI) and MySQL Workbench to create and manage the database.
🎯 Goal: Create a database called bookstore with two tables: authors and books. Add some sample data using MySQL CLI commands and then connect to the database using MySQL Workbench to view the tables.
📋 What You'll Learn
Create a database named
bookstore using MySQL CLICreate an
authors table with columns author_id (primary key) and nameCreate a
books table with columns book_id (primary key), title, and author_id (foreign key)Insert exactly two authors into the
authors tableInsert exactly three books into the
books table with correct author_id referencesUse MySQL Workbench to connect to the
bookstore database and verify the tables and data💡 Why This Matters
🌍 Real World
Bookstores and many businesses use databases to keep track of products, customers, and transactions.
💼 Career
Knowing how to create and manage databases with MySQL CLI and Workbench is a key skill for database administrators and backend developers.
Progress0 / 4 steps