bubble_chart StackLab

Database Migration

19 steps · pending Not started · person_outline Guest
arrow_back Back

Build a MySQL Database Migration for a Library System

In this codelab, you'll create the database structure for a simple Student–Book Borrowing System using MySQL or MariaDB. By the end, you will have:

    1. a students table for student records
    2. a books table for book records
    3. a borrow table that connects students and books
    4. sample data you can use while developing the PHP application
    5. a few SQL queries for testing borrowing and return status
What you'll learn: how to organize SQL into a migration file, create related tables with foreign keys, add seed data, and verify that the relationships work correctly.
Before you begin You should have: MySQL or MariaDB installed and running Access to phpMyAdmin, the MySQL command line, or another database client An existing PHP project, if you plan to connect this database to a PHP application You do not need a migration framework such as Laravel for this exercise. We will create the migration using a plain .sql file.

login Sign in to save your progress permanently. info Progress is saved in your browser session
format_list_numbered Step 1 of 19