Be ready for job interviews with practical and conceptual questions.
🔹 Basic Interview Questions
- What is the difference between WHERE and HAVING?
- Define the difference between PRIMARY KEY and UNIQUE KEY.
- What is a Foreign Key? Explain with an example.
- What is the purpose of the NOT NULL constraint?
- What are the different types of SQL JOINs in MySQL?
- How is TRUNCATE different from DELETE?
- What does SELECT DISTINCT do?
- What is the default port used by MySQL?
- Explain the role of the DEFAULT keyword in column definition.
- What is a view in MySQL and why is it used?
🔹 Intermediate Interview Questions
- How do indexes improve the performance of queries?
- What is the use of AUTO_INCREMENT in MySQL?
- What is normalization? Name the different normal forms.
- Explain the difference between CHAR and VARCHAR.
- What is a stored procedure? How is it different from a function?
- Explain the purpose of GROUP BY with an example.
- What is a composite key? Give an example.
- What is the difference between INNER JOIN and LEFT JOIN?
- What are transactions in MySQL?
- How do you back up and restore a MySQL database?
🔹 Advanced Interview Questions
- Explain how replication works in MySQL.
- What are locks in MySQL and how do they affect transactions?
- What is the difference between table-level locking and row-level locking?
- What is a trigger? Provide a use case where it’s beneficial.
- What are the ACID properties of a transaction?
- What is query optimization and why is it important?
- How do partitioned tables work in MySQL?
- What is the difference between logical backup and physical backup?
- What is a full-text index and when would you use one?
- What are deterministic and non-deterministic functions in MySQL?
🔹 Expert/Real-World Scenario Questions
- How would you handle deadlocks in a multi-user environment?
- What steps would you take to diagnose a slow query?
- Explain the master-slave replication setup. What are its limitations?
- How can you prevent SQL injection in MySQL?
- What would you do if a user accidentally dropped a production table?
- How can you implement data archiving in MySQL?
- What is the use of EXPLAIN in query optimization?
- How do you secure a MySQL server in a production environment?
- What are the effects of running MySQL in autocommit mode?
When would you use MERGE tables or partitioning over normal tables?