Microsoft SQL Interview Question | Senior Data Analyst | Deepankar Pathak

  Рет қаралды 772

Deepankar Pathak

Deepankar Pathak

Күн бұрын

📊 Mastering Microsoft SQL Interview Question 📊
Here we are going to discuss the Microsoft SQL Interview Question for the role of Senior Data Analyst, These are the same SQL Interview Questions and answers that are from the Microsoft SQL Interview Problem.
This will benefit you if you prepare for the data engineer role.
Microsoft SQL Interview Question
KPMG SQL Interview Question
Data enginee sql interview questions
Data analyst sql interview questions
Deloitte SQL Interview
data analyst interview
deloitte interview
KPMG interview
deloitte sql interview questions
big 4 sql interview questions
pwc sql interview
data analytics sql interview
data analytics
sql interview questions
sql tutorial
sql server interview questions
sql server interview questions and answers
sql interview questions and answers
top sql interview questions and answers
sql interview questions and answers in hindi
sql interview questions
sql query interview questions and answers
sql queries interview questions and answers for experienced
sql interview
sql questions and answers
top sql questions
sql interview questions for freshers
sql interview questions for beginners
sql interview questions for experienced
intermediate level sql interview questions
sql interview preparation
sql basic questions
sql questions
sql query
interview questions sql
interview question sql join
interview questions sql basic
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
SCRIPT USED:-
CREATE TABLE Weather (
ID INT,
RECORDDATE VARCHAR(512),
TEMPERATURE INT
);
INSERT INTO Weather (ID, RECORDDATE, TEMPERATURE) VALUES ('1', '01-01-2015', '10');
INSERT INTO Weather (ID, RECORDDATE, TEMPERATURE) VALUES ('2', '02-01-2015', '25');
INSERT INTO Weather (ID, RECORDDATE, TEMPERATURE) VALUES ('3', '03-01-2015', '20');
INSERT INTO Weather (ID, RECORDDATE, TEMPERATURE) VALUES ('4', '04-01-2015', '30');
INSERT INTO Weather (ID, RECORDDATE, TEMPERATURE) VALUES ('5', '05-01-2015', '12');
INSERT INTO Weather (ID, RECORDDATE, TEMPERATURE) VALUES ('6', '06-01-2015', '45');
INSERT INTO Weather (ID, RECORDDATE, TEMPERATURE) VALUES ('7', '07-01-2015', '15');
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
#dataanalytics #powerbi #sqlinterviewquestions #sql

Пікірлер: 8
@varunas9784
@varunas9784 Ай бұрын
Thank you for sharing! Here's my attemp on SQL server: ===================================== with flagged_days as (select *, LAG(TEMPERATURE, 1) over(order by recorddate) [previous day temperature], case when temperature - LAG(TEMPERATURE, 1) over(order by recorddate) > 0 then 'Y' else 'N' end [flag] from Weather) select Id, recorddate, temperature, [previous day temperature] from flagged_days where [flag] = 'Y' =====================================
@deepankarpathak983
@deepankarpathak983 Ай бұрын
Thanks for posting 👍
@prajju8114
@prajju8114 Ай бұрын
with cte_temp as ( select ID,RECORDDATE,TEMPERATURE, LAG(TEMPERATURE) OVER(order by RECORDDATE) as PREV_TEMP from Weather ), cte_2 as ( select *,row_number() over(order by temperature desc) as cnt from cte_temp ) select ID,RECORDDATE,TEMPERATURE,PREV_TEMP from cte_2 where cnt
@user-gq6cg3ls7f
@user-gq6cg3ls7f Ай бұрын
Another Approach with cte as( select *, case when temperature > LEAD(temperature) over (order by id) then TEMPERATURE END Temp, case when temperature > LEAD(temperature) over (order by id) then LAG(temperature) over (order by id) END Pre_Temp from Weather_Fri ) select id, RECORDDATE, temp, Pre_Temp from cte where temp is not null and Pre_Temp is not null
@HARSHRAJ-gp6ve
@HARSHRAJ-gp6ve Ай бұрын
with cte as( select Weather.*,LAG(temperature)OVER(ORDER BY recordDate) as x1,LAG(recordDate)OVER(ORDER BY recordDate) as x2 FROM Weather ) select id FROM cte where temperature>x1 and DATEDIFF(recordDate,x2)=1
@Abhi4upskill
@Abhi4upskill Ай бұрын
Here is my approach let me know if any thing is missing: SELECT * FROM ( SELECT *,LAG(TEMPERATURE,1)OVER(ORDER BY ID)AS PREV_TEMP from Microsoft_SeniorDA_Weather )AS A WHERE A.TEMPERATURE > A.PREV_TEMP
@deepankarpathak983
@deepankarpathak983 Ай бұрын
I'll check and update you soon.
@saurabhagrawal5466
@saurabhagrawal5466 Ай бұрын
10-Oct-2024
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 53 МЛН
PRANK😂 rate Mark’s kick 1-10 🤕
00:14
Diana Belitskay
Рет қаралды 11 МЛН
Microsoft Fabric for Power BI developers - 3.5 HOUR FREE COURSE
3:29:41
Learn Microsoft Fabric with Will
Рет қаралды 48 М.
SQL Training | SQL Tutorial | Intellipaat
3:08:06
Intellipaat
Рет қаралды 1,8 МЛН