Solve SQL Interview Questions for Data Analyst - Product Based Company Job Interview
HTML-код
- Опубликовано: 30 мар 2023
- Solve SQL Interview Questions for Data Analyst - Product Based Company Job Interview
Hi folks, this question is asked many times by the product based companies for data analyst job role.
🔖Download SQL Interview Q&A PDF: bit.ly/3M7YHxJ
👍Subscribe Now: bit.ly/3Fc7Gc6
👉Instagram: / rishabhnmishra
➖➖➖➖➖➖➖➖➖➖➖➖➖
Q1: Create match table:
CREATE TABLE match ( team varchar(20) )
INSERT INTO match (team) VALUES ('India'), ('Pak'), ('Aus'), ('Eng')
Q2: Create emp table:
CREATE TABLE emp ( ID int, NAME varchar(10) )
INSERT INTO emp (ID, NAME)
VALUES (1,'Emp1'), (2,'Emp2'), (3,'Emp3'), (4,'Emp4'),
(5,'Emp5'), (6,'Emp6'), (7,'Emp7'), (8,'Emp8')
➖➖➖➖➖➖➖➖➖➖➖➖➖
More SQL for data science Videos:
📢Full SQL Tutorial in One Video: • SQL Tutorial for Begin...
🔖 Top SQL Interview Questions and Answers: • Top SQL interview Ques...
🔖Most Asked SQL Interview Question: • Most Asked SQL Intervi...
🔖SQL Tutorial Playlist: • SQL Tutorial In Hindi
➖➖➖➖➖➖➖➖➖➖➖➖➖
📣Want to connect with me? Check out these links:📣
👉Instagram: / rishabhnmishra
👉LinkedIn: / rishabhnmishra
👉Twitter: / rishabhnmishra
➖➖➖➖➖➖➖➖➖➖➖➖➖
More Related Videos:
📢Full Excel Tutorial in one Video: • Excel Tutorial For Beg...
🔖Excel Tutorial Playlist: • Excel for Beginners | ...
🔖Complete Data Analyst Roadmap: • How to Become Data Ana...
🔖Data Analyst Roadmap, Skills and Jobs: • Data Analyst- Skills, ...
🔖What Does a Data Analyst Actually Do?: • What Does a Data Analy...
➖➖➖➖➖➖➖➖➖➖➖➖➖
Hope you liked this video and learned something new :)
See you in next video, until then Bye-Bye!
Pls ignore
SQL Interview Question
SQL Interview Questions and Answers
SQL Interview Questions
Sql interview query
advance sql query
sql for data analyst
sql question query
SQL Interview Questions Answers
Mostly asked SQL Interview Questions Answer
Commonly asked SQL Interview Questions Answer
SQL Command Based Interview Questions Answer
Advanced SQL Interview Questions Answer
Top 10 SQL Interview Questions Answer
SQL Interview Questions SQL Interview Questions and answers for Freshers and Experienced
Top 10 SQL Interview Questions Answer
SQL Interview Questions Answer
SQL Interview
SQL Interview Questions for freshers
SQL Interview Questions and answers for freshers
SQL Roadmap
SQL Interview Questions 2023
SQL Interview Experience Interview questions for SQL Experienced
I figure out here I need a self-join, windows function, and where clause to solve this query, but I didn't know about CTE. Thanks for such tutorials.
Reallt helpful Rishab bhaiya keep going ❤❤
u done a very good and helpful job bhai. we need like u more skilled people to India. Thanks
Round robin calculation (number of matches played without any repetition) = n*(n-1)/2
select a.team team_A, b.team team_B from match a
join match b
on a.team b.team
where a.team < b.team
order by team_A
above also give same output without using CTE and window function.
Learning in own pace
Thankyou Bhaiya
This is really Helpful
Phle row number daal diya..order by asc in over clause....stored in cte table...than magic happens with self join....where a. Id b.id and a.id < b.id❤
Very well explained
Thank you sir for the vdo ❤
thank you so much Rishab!
thank you sir❣
looking for more videos
Please keep going like this. Don't loose motivation if these videos doesn't get reach immediately, eventually someone like me will discover your channel in near future and keep coming to your channel for all the videos. Just keep at it
Thank you for your kind words 👍
@@RishabhMishraOfficial please post more videos of QnA and more project videos ..
Also please let us know how to escape the boredom while preparing
Thank you Sir!
Hi Sir..was waiting for this video..completed full sql course ,sql portfolio watching your channel.created my portfolio and uploaded full script in github
Awesome.. all the very best brother 👍
Waiting for part 3
Looking to build up connection as a data analyst aspirant ..
Rishab Bhaiya plz plz plz next video Data Analyst Interview Preparation Plus Preparation Resources Prr Bnao jesy app nyy Data Analyst Road Map Plus Unky Resources prr bnai the
Thanks bro ...Ek End to End Python Data Analysis project lao pls
Will upload soon
Nice informative videos!! Thank you :) Just a thought: your language and face reminds me Indian cricket captain Rohit Sharma :)
HI RISHABH YOUR TECHING METHOD IS AWESOME THEN OTHERS
I WANT TO LEARN FULL AZURE DATA ENGINEER COURSE PLEASE SUGGEST ME , WILL YOU PROVIDE ONLINE FOR THE SAME.
Thanku sir for clear Understanding 🙏
Glad it was helpful ✅️
Rishabb Bhai Plzzzzzzzzzzzzzzzzzzzzzzzz Next Video Data Analyst Preparation Plus Resources Prr anii chayee tk hum easily koi be Company Crack Kr Payen
Sir pls course on tableau u r sql course really helped pls 🙏 sir
Hello sir. I m sanjita. From past few days I m following you and watching your videos. All your videos are amazing and covers all important topics. Do you provide any certificate so that we could add that in our resume for getting a good job. I m from non tech background but now I want to do data analytics course. I will be very thankful if you give me all the information. Thanks
No i don't provide any certificates, only projects n basic skills to learn n practice data analytics skills
Bhai aap great ho
Glad you liked the video ✅️
Please do continue this session learned a lot
Sure, glad it was helpful ✅️
can you please make a video on power query
excellent content🤩
Glad you liked it ✅️
Hi sir,i have completed data analyst course,i want to do projects..can you suggest ,how can we work on real time data and projects?
In interviews, do we need to answers verbally or they give us system for answer.
Sir leetcode SQL questions enough for product based company? And please make a roadmap for data analyst preparation and resources product based company
Bcoz you are genius except few people like you rest of the channels guide to learn DSA specially when you work on technology after the interview but in data analyst we do the sem work what we prepare for interview
Do leetcode questions n work on good industry level projects. For data analyst roles we don't need DSA as a freshers
@@RishabhMishraOfficialplease share your experience about the practical work challenges as a fresher after getting the data analyst job and what kind of training you got and the client expectations you know bcoz mass recruiters hires in bulk then they train in different technologies and project in different technologies and so on
2 Query asked in interview-
Other way of solving is
Concate Both columns
Then using Rownumber function get even and odd I'd from the table then union them
Hi Sir,
please make a video about the projects to be included in our resume while applying for data analyst as a fresher.
Noted ✅️
Hello! I appreciate your work. I want to ask you one thing to learning or solving sql query how much maths needs to be required?
Great content sir ! Apart from topic i have question for you why do you switch from digital marketing . Is not worth it . Can explain pro & cons of industry . & Lil bit future prospect of Digital marketing. As ai coming to the picture
Okayy noted ✅️
Select a.team as team_A,b.team as team_b from match a,match b where a.team>b.team and a.teamb.team
Šir į have one question
Path learning python for data analytics
Sir I want to ssis aur ssms mai kya difference hai aur data analyst bane ke liye ana chahiye
main khudd data analyst hun but kaffi sari chize hai jo abhi mujhe nhi pta hai to me ye samjh paa rhi hun ki kai logo ko isme bhi problem hoti hai ki resum me kyq kya update kre or project details me kya likhe job kaise milegi
Kitna tym lagta hai 3no ko seekhne mej
Aapka.no.do plzz😢😢 bhaiya
Sir I m cllg student so aap bata skte h data analyst me salary zada h ya Java backend me salary zada h or konsa sikhna chahiye
Match question me oh join is not required, just use where conditions a. I'd less than b. I'd. That's more than Enough
Hi rishabh I'm beginner in power Bi can you please help i installed it but in the right side of sheet visualization panel is not showing also the other panels like data only filter thing appears can you tell how to fix it? Pleaseeee helpppppp
sir,mysql benchmark,it dont have string__agg function ,is there any option to solve
Hello rishab sir Plz help how to use TCL .type means commit & save point in SQL server Plz sir
Rishabh bhai please make project video on Tableau
Noted ✅️
Video is really helpful but the maths part in Q1 is not clear, it is confusing, we don't know why r =2 , it'd be great if you could explain that.
I started sql with theory I want to know how to practice it .plz let me know
Hello sir I want to take admission of database administrator, for sql does my math needs to be good or math is not required??
create for 30 days python challenge pdf with hackerrank problem will be very helpfull same as sql sheet
That's a nice suggestion, will work on it 👍
Help to build portfolio how to add sal project on portfolio plz tel
In 1st table match one can we not include an extra column as a primary key?
There can be 1 pri column in a table
Voice is enough.
One more solutions using 3 CTE's. Little complex than the smarter solution u mentioned.
WITH CTE AS (
SELECT A.NAME AS TEAM1, B.NAME AS TEAM2
FROM TEAMS AS A
CROSS JOIN TEAMS AS B
),
CTE_2 AS (
SELECT *
FROM CTE
WHERE TEAM1 TEAM2
),
CTE_3 AS (
SELECT GREATEST(TEAM1, TEAM2) AS FIRST, LEAST(TEAM1, TEAM2) AS SECOND
FROM CTE_2
)
SELECT DISTINCT *
FROM CTE_3
ORDER BY SECOND;
If it works it good 👍
bahi itna complex likhoge to khud hi phas jaaoge....keep code as simple as possible.......
Which one is most demanding for a job.?
MySQL, MS SQL, postgresql
MS sql, but it depends on job n company
Sir, plz make the videos on solution of sql queries of leetcode
Okayy noted
Aap apna khud ka data analytics course karate hai kya bhaiya mujhe sikhna hai data analytics aapse live batch hai kya
Sir....sql 2.5hr wala srt Kiya Hai abhi....your way of explanation is very nice.....but sir Kuchipudi doubts aaye toh kaise contact Krein aapko
Pls msg on Instagram, link in video description
With cte as
(Select *, lead(team,1) over (order by (select null)) as Tab_1
from match
union
select *, lead(team,2) over (order by (select null)) as Tab_1
from match
union
select *, lead(team,3) over (order by (select null)) as Tab_1
from match)
Select * from cte where Tab_1 is not null
Is this solution valid for Q1? The sequence is not the same. But results are more or less the same. Do let me know. Thanks!
is it Last video of this series??
Sir ek video banai jis mai Business analyst wala ko kitna SQL aana chahiye please
Noted ✅️
@@RishabhMishraOfficial Thank you Sir
Do you provide any courses for power BI ?
Yes it's on this youtube channel
Sir mere English Communication week hai
To muje interview me Problem hoga kya Data analysis role ke leye
Only basic English is required
Sir could please tell me that, excel's which vba macros are used for data analytics
Check the data analyst roadmap video, hv shared all the details there along with free resources
@@RishabhMishraOfficial Thanks brother, watched full video of roadmap and I got full knowledge of it. I will implement it.
Bhai if someone has less understanding of maths concepts , can he/she do data analyst job ?
Yess
they can do the job.. having that strong logic definitely helps to pick up new concepts more quickly
i have an interview today for sql developer but i dont have practical knowledge about complex queries .'😢 should i go for interview or not
Yes, never miss any interview. It gives you a job or learning
I have a question, when you completed your sql for the first time, were you able to solve all these problems without any help??...because I have learned sql but sill get confused while solving these kind of problems.
No.. i did practice first then i tried some advanced level questions. After that i was able to solve it 👍
Thank you, Rishabh for this video!! It would be helpful if you provide sample interview questions for Python also!!
Okayy noted ✅️
aap data analyst students ki itni help kr rhe but aap ek or help kriye sabhi data analyst ki
LinkedIn me data analyst valo ko kya kya update kre ko vo job ke liye select ho or resume me bhi kya kya update kre kyu ki abhi tk ini details me koi bhi nhi bataya hai aap batao or video bhi banao
Okayy noted ✅️
Rishabh Mishra There is a error in your database file its not working
How is it r= 2 ?
Please launch a course on sql
Already uploaded
@@RishabhMishraOfficial sir python project for data analyst
Coming soon 🚀
Sir data science ka course krke job mill skti hai na...diploma basis pr
Yess
Mat kr bhai
bro would you like to train me by online classes?
Is this necessary to learn to be a business analystics ??
Yes, it helps to understand data better
सब कुछ सीखने के बाद सबसे बड़ी समस्या है, जॉब के लिए intervew/apply/ रेफरल प्राप्त करना,कैसे इंटरवेव के लिए अप्लाई करें।यदि कुछ इसका तरीका हो तो प्लीज बताइए
Okayy, noted. Will make a video on this ✅️
@@RishabhMishraOfficial thnx for it and I will wait
Data analytics mein job k liye apply kon kon kr skta hai sir reply jrur karna?
Koi bhi, bus skills aur projects aata ho
@@RishabhMishraOfficial ok thanks a lot
Apki video se krege tyaar
Is this for Freshers?
Yess
There is no job for freshers in market
why is r=2? can u please explain me
Already explained in the video 🤦♂️
n = 4 bcoz we have 4 teams
And r = 2 bcoz there will be a match btw 2 teams
@@RishabhMishraOfficial thanks
One request just hide yourself.
For 2nd question we can also use this soln:
select CONCAT(id_name,',',lead)as Result,
row_number() over (order by id) as groups
from (select *,
lead(id_name,1) over (order by id)as lead
from(Select *,CONCAT(id,' ',name)as id_name
from employee) a)b
where id%2 0
Sir data analyst ke liye konsa chahiye btech me
•computer science engineering
•computer science AI
•computer science engineering and artificial intelligence
•computer science engineering and data science
Koi bhi branch se karlo but skills are important aur vo tumko apne aap se sikhna hoga
On serious note you need to speak slow really difficult to understand to a person like me whose understanding compiler runs slow
Okayy noted ✅️
WITH cte_new AS (
Select *,ROW_NUMBER() OVER(ORDER BY team ASC) from matches
)
I am trying this query for cte but it is giving me error in my sql , can anyone tell why so?
Can also use the below when you dont know the number of rows.
'''Lead is used the get the next row'''
WITH CTE_Temp AS
(
SELECT employee_id, name,
LEAD(employee_id) OVER (ORDER BY employee_id) AS next_id,
LEAD(name) OVER (ORDER BY employee_id) AS next_name
FROM employee
)
Select employee_id, CONCAT(employee_id,', ', name,', ', next_id,', ', next_name) from CTE_Temp
where next_name IS NOT NULL
If the output matches then yess you can use it
Note - In MySQL STRING_AGG is not supported. Alternative is to use GROUP_CONCAT.
with cte as
(select *,
concat(id, ' ', name) as con,
ntile(4) over(order by id) as rn
from emp_1)
select group_concat(con separator ', ') as result, rn as 'groups'
from cte group by rn;
Thanks Rishabh.
Bro how can I contact you i wannt advice from you
Pls msg on Instagram or LinkedIn, links in video description
sir i messaged you on instagram but you didn't reply
Pls tell me your account name on Instagram