Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Creating a Database and Table in MySQL

Working with databases and tables is a foundational skill for any database administrator. This ability to create multiple databases and multiple tables within each database allows administrators to ensure that data is grouped in a logical order. In this lab, you will walk through creating and deleting databases and tables in a MySQL server.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 22, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Log into the MySQL Database

    As the cloud_user, run the following command and enter the password from the instructions (under Additional Information) when prompted:

    # mysql -u root -p

  2. Challenge

    Delete the `bad_data` Database from the MySQL Server

    In the mysql prompt, run the following command:

    mysql> DROP DATABASE bad_data;

  3. Challenge

    Create a Database Named `customer_info`

    In the mysql prompt, run the following command:

    mysql> CREATE DATABASE customer_info;

  4. Challenge

    Delete the Table `payment_info` from the `2004_data` Database

    In the mysql prompt, change the database to 2004_data:

    mysql> USE 2004_data;

    Drop the payment_info table:

    mysql> DROP TABLE payment_info;

  5. Challenge

    Create a Table Named `payment_info` in the `customer_info` Database According to the Characteristics Provided in the Instructions

    Change the database to customer_info:

    mysql> USE customer_info;

    Create the payment_info table with the characteristics provided:

    mysql> CREATE TABLE payment_info (cust_id INT AUTO_INCREMENT PRIMARY KEY, user_name VARCHAR(50) UNIQUE, card_number INT, purchase_item VARCHAR(255));

    Verify that the table was created as expected:

    mysql> DESCRIBE payment_info;

    Exit the mysql prompt:

    mysql> exit

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight