0% found this document useful (0 votes)
14 views1 page

SQL Interview Set 1

Uploaded by

Omkar Jingar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

SQL Interview Set 1

Uploaded by

Omkar Jingar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

4. How do you find duplicate records in a table?

sql
SELECT ColumnName, COUNT(*)
FROM TableName
GROUP BY ColumnName
HAVING COUNT(*) > 1;
5. What is the difference between INNER JOIN and LEFT JOIN?
- INNER JOIN: Returns records that match in both tables.
- LEFT JOIN: Returns all records from the left table, and matching records from the
right table (NULL if no match).
6. Explain window functions and provide an example.
Window functions operate on a set of rows related to the current row, without
collapsing them into a single output.
Example:
sql
SELECT EmployeeID, Salary,
RANK OVER (PARTITION BY DepartmentID ORDER BY Salary DESC) AS Rank FROM Employees;

You might also like