SQL SERVER INTERVIEW QUESTIONS Part-2
Q1. How to list all employees hired in the last 8 months?
Q 2. How to find the department with the lowest average salary?
Q 3. How to write a query to check if a table is empty?
Q 4.How to get the count of employees in each department?
Q 5.Write a query to fetch the details of employees with the same salary.
Q 6. How to get the current month’s name from SQL server?
Q 7 .How can you find employees whose salary is between 50,000 and 1,00,000?
Q 8. How can you delete duplicate rows in a table ?
Q 9. How to retrieve employee names and salaries in a single string?
Q 10. Write a query to display department-wise total and average salary.
Q 11. How to calculate the total salary of all employees?
Q12. Write a query to calculate the total sales per customer in sales in a sales table.
Q 13. How to write a query to list all employees without a department?
Q 14. How to write a query to find the total number of employees in each job title ?
Q 15.How to find all employees who work in both departments 201 and 202?
Q 16. Write a query to get all employee records in XML format.
Q 17. Write a query to display the current date and time in SQL.
Q 18.How to convert a string to lowercase in SQL?
Q 19. How to find the second highest salary for each department?
Q 20. How to write a query to find all employees who joined in the year 2025?
Q 21. How can you optimize SQL queries to improve performance?
Q 22. How to find the second - largest value from a table?
Q 23. How is the LIKE operator used in SQL?
Q 24.Write a query to find the maximum salary and minimum salary in each department.
Q 25. How to get the common records from two tables?