Interview Questions.
Interview Questions.
1Y2M
3Y
9,10,11,12,1
Table : Student
Table : Subject
Table : Employee
Table : Department
;With CteIns AS
(
Select BANK,PRICE,isDuplicate,row_number()over(Partition
by BANK order by BANK) RN from #Instruments
)
Update CteIns set isDuplicate=Case when RN=1 then 0 else 1 end
Query
SELECT PersonID,Name,ISNULL([Add2],'') as [Add1], ISNULL([Add4],'') as
[Add2],ISNULL([Add6],'') as [Add3] FROM
(
Select PersonID, Name , 'Add' + CAST(ROW_NUMBER() over (partition by personID
order by personID)as varchar) as Col
,split.value From #Test
CROSS APPLY string_split(Address,'|') as split
) as tbl
PIVOT (MAX(value) FOR Col in ([Add2],[Add4],[Add6])) AS Pvt
o/p
L.J = 6
R.J = 5
F.J = 7
C.J = 20
Table B
ID NAME
101 A
103 C
102 B
103 C
101 A
Table A
ID NAME
101 A
102 B
103 C
104 D
A B
ID ID
1 NULL
NULL 1
NULL NULL
1
A B
ID ID
1 NULL
NULL 1
NULL NULL
6. Types of indexes
1. Error handling
-- Basic
Scenario Based.
-- Advanced
Ans :-
Breakpoint – Used to debug the code. And viewing the value of variables and following the flow of the
logic as they step through the source code
Success (Green) :- precedence executable must execute successfully so that the constrained
executables can execute. The color of success precedence is green.
Failure (Red):- precedence executable must fail so that the constrained executable can execute.
Its color is red.
Completion (Blue) :- It runs the constrained executable regardless of the state of precedence
executable task. The color for completion precedence constraint is blue.
Q.3. What are different SQL Server versions you have worked ?
Ans :- Primary Key , Foreign Key, Unique Key, Check , Default, Not Null
Ans :- The most commonly used Cluster & Non cluster index in SQL Server. But apart from that below are
other types of indexes in sql server.
- Filtered Index
- Hash Index
- Unique Index