MySQL Interview Revision Plan
1. Core Concepts Revision (1.5 hours)
- DBMS vs RDBMS, ACID properties, Normalization (1NF to 3NF), ER Diagrams.
- Data Types: Numeric, String, Date/Time, NULL vs NOT NULL.
- Table Operations: CREATE, ALTER, DROP TABLE, PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK, DEFAULT.
2. Query Practice (2 hours)
Basic Queries:
- SELECT, WHERE, DISTINCT, ORDER BY, LIMIT, INSERT, UPDATE, DELETE
Joins:
- INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN
Aggregate Functions:
- COUNT(), SUM(), AVG(), MIN(), MAX(), GROUP BY, HAVING
Subqueries and Aliases:
- Scalar, correlated subqueries, AS keyword
Set Operations:
- UNION (MySQL doesn't support INTERSECT/EXCEPT directly)
3. Advanced Concepts (1 hour)
- Indexes: Purpose, performance benefits, clustered vs non-clustered.
- Transactions: START TRANSACTION, COMMIT, ROLLBACK.
MySQL Interview Revision Plan
- Stored Procedures and Functions.
- Triggers and Views.
- Optimization: EXPLAIN, avoid SELECT *, smart indexing.
4. Common Interview Questions (1 hour)
- Types of JOINs and examples.
- WHERE vs HAVING.
- Indexing and performance.
- GROUP BY mechanics.
- Normalization vs Denormalization.
- Stored procedures explained.
- SQL Problems:
- Second highest salary:
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
- Find duplicates:
SELECT name, COUNT(*) FROM employees GROUP BY name HAVING COUNT(*) > 1;
5. Quick Practice Resources
- LeetCode SQL: [Link]
- W3Schools SQL: [Link]
- Hackerrank SQL: [Link]