Performing SQL Commands in MariaDB

30 minutes
  • 5 Learning Objectives

About this Hands-on Lab

Understanding databases is an essential skill for information security professionals. In this hands-on lab, you will learn about relational databases and how to perform SQL statements.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a Student Record

Create a student record for yourself, and assign yourself a 3.7 grade point average (GPA).

Get started by using the command:

sudo mysql

Start MariaDB and access the database using the command:

use school;

Hint: Use the following command to see all the tables in the database:

show tables;

Hint: Use the following command to see all the columns in a table:

desc <table>;
Identify Available Courses

Investigate the courses table, and find out which courses are available at the school.

Find a Teacher’s Salary

Find the salary amounts for the teachers of courses cs101 and cs201 using the WHERE and OR SQL statements.

Create a Teacher Record

Create a teacher record for a teacher named tom pine, who is paid a salary of 35000.

Update cs201

Assign tom pine as the teacher of cs201, using the UPDATE statement, and then add yourself to the course.

Additional Resources

In this hands-on lab, you will play the role of a malicious student who has access to their school's database. As a malicious student, you want to improve your GPA and make some course modifications. In doing these actions, you will understand how hackers manipulate databases for their benefit. This lab's database uses MariaDB, so be sure to review the MariaDB documentation for a list of SQL statements and examples.

What are Hands-on Labs

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?