Answer: To find duplicate rows, we have to ask the interviewer what is the criteria for considering two rows duplicate of each other.
Let say in a given table Test_table if column_1 and column_2 of two rows are same, then these rows are considered equal.
We can use GROUP BY clause to group the rows with columns that are used for checking equality. Any group that have more than 1 rows will have duplicate rows.
Query to find duplicate will be as follows:
SELECT column_1, coulmn_2, count()
GROUP BY column_1, coulmn_2
HAVING count() > 1