SQL Interview Questions
SQL Interview Questions
Duplicate query :
Select count (id) as count from table group by id having count >1;
Row number() :
SELECT ROW_NUMBER() OVER(ORDER BY name ASC) AS Row#,
name, recovery_model_desc
FROM sys.databases
WHERE database_id < 5;
SELECT
ROW_NUMBER() OVER(PARTITION BY recovery_model_desc ORDER BY name ASC)
AS Row#,
name, recovery_model_desc
FROM sys.databases WHERE database_id < 5;
union /union all : Union all recds of both the quries or tables with out duplicates
Union all with duplicates
ETL questions:
ODS operational data staging : intermediate staging area which has integrated data from
different sources.
Staging : intermediate area used for ETL process
View: View is a virtual model or subset of the tables without showing complete details and
hiding the relations and other technical details for Security or for only read operations
Calculation errors:
ETL Job running commands:
Unix commands :
LS list
Grep Search for a char or word
Cd open the directory
Sh run shell script
Cp copy
Stored procedure :
Triggers:
Data mart : A data mart is a subset of a data warehouse focused on a particular line of
business, department, or subject area.
CASE :
Case (
If (select id from emp where sal is null)
Then id
Else ‘2’) as id;
1.Count the total number of employees having a salary more than 10000.
Select count(EMPID) from table WHERE sal >10000
6.Count the total salary department wise where more than 2 employees exist.
Select count (deptid)dpt,sum (sal) from table group by deptid having dpt >2;
7.Difference between drop,delete and truncate with each SQL query example and
explanation
8..Difference between group by, where and having clause with query example.
Select id from table group by id having sal >1000;
Select id feom table where id=! 5 group by id;
9. Prepared and run SQL queries to verify Dimension and Fact tables.
Testing
STLC
Bug Lyf Cycle
Types of Testing : Integrated,functional,API
RTM
Exit and entry crieteri
DEFERRED
Agile
Sprint Retrospective :
Sprint Review :
Sprint panning :
Prd backlog :
Sprint backlog:
Scrum master :
Product owner :
Scrum