Brief Summary
Meesho conducted a hiring drive with tricky SQL questions to test problem-solving skills. This is a challenge to test your SQL skills and see if you can crack interviews at top companies like Meesho. The questions cover topics like:
- Retrieving top N records
- Filtering based on aggregate conditions
- Finding customers who bought all products
- Finding the Nth highest salary.
Meesho Hiring Drive SQL Challenge
Meesho recently had a hiring drive where they asked some challenging SQL questions. The aim was to assess the candidates' ability to solve real-world problems using SQL.
Q1: Top 3 Highest-Paid Employees
The question asks how to retrieve the top 3 highest-paid employees from an 'Employees' table. The correct answer is:
- D:
SELECT * FROM Employees ORDER BY salary DESC FETCH FIRST 3 ROWS ONLY;
This query sorts the employees by salary in descending order and then fetches only the first 3 rows, effectively giving you the top 3 highest-paid employees.
Q2: Customers with More Than 5 Orders
This question requires you to identify customers who have placed more than 5 orders.
Q3: Customers Who Spent More Than Rs. 10,000
The question is about finding customers who have spent more than Rs. 10,000 in total orders.
Q4: Customers Who Bought All Products
This question involves two tables: Customers, Orders, and Products. The task is to write a query to find customers who have purchased all products available in the Products table. The correct answer is:
- Both A and C
Q5: Second Highest Salary
Given an Employees table, the question asks for a query to find the second-highest salary in the company.