0% found this document useful (0 votes)
8 views

Interview Questions.

Uploaded by

Akash Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Interview Questions.

Uploaded by

Akash Gupta
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 9

3y1M

1Y2M

3Y

9,10,11,12,1

Table : Student

Table : Subject

1. Find the maximum marks. -- 77

2. Find the minimum marks. -- 30

3. Find the maximum marks for each subject.


4. Find the minimum marks for each subject.

5. Find the Average marks subject wise.

Table : Employee

Table : Department

1) Find the maximum salary ? 6000

2) find the minimum salary ? 2799


3) Find the Maximum salary department wise

4) Find the Minimum salary department wise.

5) Find the Average salary of each department.

Id Name Salary Dept_id


1 A 5000 101
2 B 5000 102
3 C 4000 101
4 D 2000 103

How to split Numeric and Non numeric values from string.


@str = 'A12A9B34CD56Z'

Create a comma separated list from column using select statement

Select * From #Tmp


Select Name,STRING_AGG(EmailID,';') from #Tmp group by name

UPDATE COLUMN TO 0 FOR FIRST RECORD AND 1 FOR DUPLICATE RECORD

;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

PersonID name Address


2 Dhirndra shukla add1| virar| add2|Borivali|add3|Mumbai
Sanjay kumar
1 pandey add1| kalyan| add2|Thane|2134|
I. J = 4

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

SELECT * FROM A WHERE ID NOT IN (SELECT ID FROM B)

Upto 7 Years of exp.

1. Difference between CTE & Temp Table Table variable.

2. Difference between sp & fuctions.

3. What is CTE & Its Types ?

4. What are views in sql ..& why it is used.

6. Rebuild index vs Reorganize index. / Index scan vs index seek

5.Joins & its typs.

6. Types of indexes

Upto 10 Years of exp.

1. Error handling

2. Optimaztion in sql server.

3. Explain different types of component of Execution plan

4. What is Normalization in sql & its types.

5. What is Transaction & its isolation levels in sql.


6. Table partition

7. Fregmentation & Defregmentation in sql server & why it is used.

8. What are statistics in sql server & why it is updated.

Interview Questions for SSIS.

-- Basic

What are different types of tarnsactions in SSIS.

What are syemetric & Asymetric transaction in SSIS.

Scenario Based.

-- Advanced

Q.1. What is difference between checkpoint & Breakpoint in SSIS ?

Ans :-

Checkpoint – Used to start the package from the point of failure.

For that need to configure 3 properties such as ChekcPointFileName , CheckpointUsage – (Never,


IFExists, Always ), SaveCheckpoint.

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

Q. 2.What is precedence constraint in SSIS ? What are properties/values it has?

Ans :- to define the program flow from one task to another

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 :- SQL SERVER versions 2012,2014,2016,2017,2019

Q.4. What are different constraints available in SQL Server ?

Ans :- Primary Key , Foreign Key, Unique Key, Check , Default, Not Null

Q.5. What are different types of indexes in SQL Server ?

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.

- Column Store Index

- Filtered Index

- Hash Index

- Unique Index

You might also like