Introductiontodatabase Tutorial Lab Activity
Introductiontodatabase Tutorial Lab Activity
Exercises
1. Create a Database:
CREATE DATABASE StudentDB;
2. List All Databases:
SHOW DATABASES;
3. Use and Drop a Database:
• Use the "StudentDB" database:
USE StudentDB;
• Drop (delete) the "StudentDB" database:
DROP DATABASE StudentDB;
4. Create Tables:
• Inside "StudentDB," create a table named "Students" with the
specified columns and data types:
CREATE TABLE Students ( StudentID INT PRIMARY KEY,
FirstName VARCHAR(50), LastName VARCHAR(50), DateOfBirth
DATE, Email VARCHAR(100), GPA DECIMAL(3, 2) );
5. List Tables:
• List all the tables in the current database ("StudentDB") to verify
that the "Students" table was created:
SHOW TABLES;
6. Describe Table:
• Describe the structure (columns and data types) of the
"Students" table:
DESCRIBE Students;
7. Drop a Table:
• Drop (delete) the "Students" table: