A complete, progressively structured guide covering 80 real interview questions with clear answers, code, and pro tips.
Level: Basic — Almost always the opening question in any MySQL interview.
MySQL is a free, open-source Relational Database Management System (RDBMS) that stores data in structured tables made up of rows and columns. It uses SQL (Structured Query Language) to define, manipulate, and query that data.
It was originally developed by MySQL AB, later acquired by Sun Microsystems, and is now owned by Oracle Corporation. Because it is fast, reliable, and easy to use, MySQL powers a huge portion of the web and is the "M" in the popular LAMP stack (Linux, Apache, MySQL, PHP/Python/Perl).
A simple statement to create a database and a table in MySQL:
-- Create a new database
CREATE DATABASE company;
-- Select the database to use
USE company;
-- Create a table inside it
CREATE TABLE employees (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
salary DECIMAL(10, 2),
hired_on DATE
);