Introduction to Databases and MySQL

What is a Database?

What is SQL and MySQL?

Why MySQL

What is MySQL?

What is RDBMS?

What is a Relational Database?

MySQL Data Types (Common Ones)

Data Type Description Example
INT Whole number 123, -1
VARCHAR Variable-length string (up to limit) 'Hello', 'abc123'
TEXT Long text 'This is a big note'
DATE Date only '2025-04-01'
DATETIME Date and time '2025-04-01 14:30:00'

What is a Database Table?




Creating a Database and Inserting Student Records in MySQL

SQL:
			-- Create a new database
			CREATE DATABASE school;
			
			-- Switch to the new database
			USE school;
			
			-- Create the students table
			CREATE TABLE students (
			  id INT AUTO_INCREMENT PRIMARY KEY,
			  name VARCHAR(100),
			  age INT,
			  email VARCHAR(100)
			);
			
			-- Insert multiple student records
			INSERT INTO students (name, age, email) VALUES 
				('Alice', 14, 'alice@school.com'),
				('Bob', 15, 'bob@school.com'),
				('Charlie', 13, 'charlie@school.com'),
				('Diana', 14, 'diana@school.com'),
				('Ethan', 15, 'ethan@school.com');