In the interview, I was given SQL-based problem scenarios to test query writing, joins, CTEs, aggregate functions, and handling NULL values. Tasks included creating an employee table, inserting data, finding the highest-paid employee in each department, identifying customers with/without orders, fetching the latest order per customer, and applying HAVING with NULL conditions. The objective was to evaluate my ability to translate business requirements into optimized SQL queries with accurate results.
To solve the given problems, I showcased SQL proficiency across multiple scenarios. I began by creating an Employee table with relevant attributes and wrote queries to:
I also demonstrated best practices by clarifying that:
These solutions highlighted not only my SQL query-writing ability but also my understanding of optimization, correctness, and relational data handling best practices.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?