Practise these 5 intermediate SQL interview questions today!
1. Write a SQL query for cumulative sum of salary of each employee from Jan to July. (Column name – Emp_id, Month, Salary).
2. Write a SQL query to display year on year growth for each product. (Column name – transaction_id, Product_id, transaction_date, spend). Output will have year, product_id & yoy_growth.
3. Write a SQL query to find the numbers which consecutively occurs 3 times. (Column name – id, numbers)
4. Write a SQL query to find the days when temperature was higher than its previous dates. (Column name – Days, Temp)
5. Write a SQL query to find the nth highest salary from the table emp. (Column name – id, salary)
Post #1937
1.69K
- ❤ 4