Interview Question

Count word in sql server

In this blog i am going to write a function which returns word count in sql server. Sql server does not provide inbuilt function for calculating word count. So we have to write a custom function in sql. CREATE FUNCTION… Continue Reading →

What is output when we write null = null in where clause

What is output when we write null = null in where clause

Toggle in sql server

update NewTable set status= case status when 1 then 0 when 0 then 1 end

Delete duplicate row in sql

In this article we learn that how to delete duplicate row in sql. Let’s create a table and name it NewTable. Create table NewTable ( Name varchar(30), Age int ) Now i am going to insert some demo record in… Continue Reading →

Is it possible to have more than one identity column in sql

I want to create more than one identity column in my table. So is it possible to do that. No, We can not do that. Let’s understand by example. I am trying to create a table which has two column… Continue Reading →

Find Nth highest salary using Dense_rank function in sql

In this article we learn how to find nth highest salary using Dense_Rank function is sql. Let’s create a table and name it table1. CREATE TABLE [table1]( [id] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](30) NULL, [Salary] [int] NULL, [DepId] [int]… Continue Reading →