SQL Roadmap - Module 3: Installing & Setting Up MySQL
This module helps you understand the MySQL environment and how to start working with
it. The focus is on concepts that are useful in interviews and for hands-on practice.
1. What is MySQL Server?
MySQL Server is the database software that stores your databases, tables, and data. It listens
for SQL queries, executes them, and returns the results.
2. What is MySQL Workbench?
MySQL Workbench is a graphical tool (GUI) used to connect to the MySQL Server. It lets you
write SQL queries, create databases and tables, view data, and manage the server without
using the command line.
3. MySQL Server vs MySQL Workbench
MySQL Server MySQL Workbench
Stores databases and data Provides a graphical interface
Executes SQL queries Used to write and run SQL queries
Runs as a background service Runs as a desktop application
Required Optional but recommended
4. Connecting to MySQL
Open MySQL Workbench.
Create or select a local connection.
Enter the root username and password.
Click Connect.
If the connection succeeds, you can start writing SQL queries.
5. Understanding the Workbench
Navigator - Shows databases (schemas).
SQL Editor - Write SQL queries here.
Output - Displays query results and messages.
Schemas - Shows databases, tables, views, and procedures.
6. Your First SQL Query
The simplest query:
SELECT 1;
Output: 1
This confirms that MySQL is connected and working.
7. Create Your First Database
CREATE DATABASE company_db;
A database is a container that holds related tables.
8. Select the Database
USE company_db;
This tells MySQL that all upcoming commands should use company_db.
9. Create Your First Table
CREATE TABLE employees (
id INT,
name VARCHAR(100),
age INT
);
10. Insert Your First Record
INSERT INTO employees (id, name, age)
VALUES (1, 'John', 25);
11. View the Data
SELECT * FROM employees;
Simple Workflow
Create Database
↓
Use Database
↓
Create Table
↓
Insert Data
↓
Retrieve Data
Module 3 Summary
MySQL Server stores and manages databases.
MySQL Workbench is used to interact with the server.
SELECT 1; is a quick connection test.
CREATE DATABASE creates a database.
USE selects the active database.
CREATE TABLE creates a table.
INSERT adds data.
SELECT retrieves data.
Interview Quick Questions
1. What is MySQL Server?
2. What is MySQL Workbench?
3. Can MySQL Server run without Workbench?
4. What does USE database_name do?
5. What is the purpose of SELECT 1;?