1.SQL Query to find second highest salary of EmployeeAnswer : There are many ways to find second highest salary of Employee in SQL, you can either use SQL Join or Subquery to solve this problem. Here is SQL query using Subquery : 1. select MAX(Salary) from Employee WHERE Salary NOT IN (select MAX(Salary) from Employee …
How would you handle error in SQL SERVER ?
What is CTE? What are the Advantages of using CTE?
TABLESAMPLE allows you to extract a sampling of rows from a table in the FROM clause. The rows retrieved are random and they are not in any order. This sampling can be based on a percentage of number of rows. You can use TABLESAMPLE when only a sampling of rows is necessary for the application …
What is the STUFF function and how does it differ from the REPLACE function?
Can a stored procedure call itself or recursive stored procedure? How much level SP nesting is possible?
1. The master database holds information for all databases located on the SQL Server instance and is the glue that holds the engine together. Because SQL Server cannot start without a functioning master database, you must administer this database with care. 2. The msdb database stores information regarding database backups, SQL Agent information, DTS packages, …
What is sub-query? Explain properties of sub-query?
What is User Defined Functions? What kind of User-Defined Functions can be created?
What are the different ways of moving data/databases between servers and databases in SQL Server?