← Lesson
BitWithBite
SQL · Quick Reference

Lesson 2 — Setting Up MySQL & First Queries Cheat Sheet

SQL
In one line: Option A — Local Install: MySQL Community Server (free download from mysql.com) + MySQL Workbench GUI. Best for real projects.

Key Ideas

1Setup Options. Option A — Local Install: MySQL Community Server (free download from mysql.com) + MySQL Workbench GUI. Best for real projects.

Code Examples

-- See all databases on the server SHOW DATABASES; -- Create a new database CREATE DATABASE school_db; -- Select database to use USE school_db; -- See current database SELECT DATABASE(); -- Delete a database (CAREFUL — no undo!) -- DROP DAT...
USE school_db; CREATE TABLE students ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(100) NOT NULL, age INT, email VARCHAR(150) UNIQUE, grade VARCHAR(5), created_at TIMESTAMP DEFAULT CURRE...
-- Insert one student INSERT INTO students (name, age, email, grade) VALUES ('Sara Ahmed', 17, 'sara@example.com', 'A'); -- Insert multiple rows (more efficient) INSERT INTO students (name, age, email, grade) VALUES ('Ali Khan', 16, 'ali@examp...