Docsity

Top 10 SQL Interview Questions and Answers for MySQL, Cheat Sheet of Compilers

Partial preview of the text

Download Top 10 SQL Interview Questions and Answers for MySQL and more Cheat Sheet Compilers in PDF only on Docsity!

TOP 10TOP 10

SQL SQL

INTERVIEW INTERVIEW

QUESTIONS QUESTIONS

MySQL Delete Duplicate Rows but keep one

Delete the duplicate rows but keep latest: using GROUP BY and MAX

Delete the duplicate rows but keep latest: using JOINS

Delete the duplicate row but keep oldest: using JOINS

Delete the duplicate row but keep oldest: using ROW_NUMBER()

Clustered and Non Clustered Index

Differentiate between the two with an example?

When to Use a Clustered Index? Show with an example.

When to Use a Non-clustered Index? Show with an example.

How many clustered indexes & non clustered indexes are allowed per table?

Should Primary Keys be Clustered or Non- clustered Index?

Which is Faster: Clustered or Non-clustered Index?

What is the difference between delete, truncate & drop?

Which of these is DDL & DML command?

Can we use the "where" clause with each one of them?

Which of the above is executed by taking table lock?

In which of the three one can "not" retrieve data even after the rollback is performed?

Which of the above is executed by taking row-level lock?

What is the primary use case of each one of the above mentioned?

Rank Scores

Trips & Users

Duplicate Emails

Customer who never orders