Real Data Science SQL Interview Questions and Answers # 2 | Data Science Interview Questions

preview_player
Показать описание
Hi friends! Welcome back to SQL Sundays! A weekly SQL data science interview questions and answers walkthrough.

This is another data science SQL interview question and answer done from beginning to end in a real interview style.

🔗Affiliates
========================
My SQL for data science interviews course (10 full interviews):

365 Data Science:

Check out StrataScratch for data science interview prep:

📲Socials
========================

🤯Study with Tina
========================
Study with Tina channel:

How to make a studying scoreboard:

Scoreboard website:

livestreaming google calendar:

🎥Other videos you might be interested in
========================
SQL Sundays Playlist:

How I consistently study with a full-time job:

How I would learn to code (if I could start over):

🐈‍⬛🐈‍⬛About me
========================
Hi, my name is Tina and I'm a data scientist at a FAANG company. I was pre-med studying pharmacology at the University of Toronto until I finally accepted that I would make a terrible doctor. I didn't know what to do with myself so I worked for a year as a research assistant for a bioinformatics lab where I learned how to code and became interested in data science. I then did a masters in computer science (MCIT) at the University of Pennsylvania before ending up at my current job in tech :)

📧Contact
========================
youtube: youtube comments are by far the best way to get a response from me!

========================
Some links are affiliate links and I may receive a small portion of the sales price at no cost to you. I really appreciate your support in helping improve this channel! :)
Рекомендации по теме
Комментарии
Автор

Remember to follow along and write your own solution! If you do these with me every week I promise y'all gonna crush the interview!

TinaHuang
Автор

select ds,
AVG(Case when action = 'Accepted' then 1 else 0 END) As acceptance
from friend_req
uests
group by 1

jasonwong
Автор

Hi Tina, I think this one works for MYSQL, which looks a little simple,
SELECT ds, 100 * SUM(IF (actions = 'Accepted', 1, 0)) / count(actions) as accepted_rate
FROM fre
GROUP BY ds

MingYunFengShui
Автор

Your videos are amazing Tina! I'm currently preparing for a FAANG interview for a DS intern position and your style of presenting and talking through your approach while writing queries has been really eye opening and fun to watch at the same time. Thanks for creating such awesome content :)

HenryTechBoy
Автор

Really enjoying these SQL interview questions and answers. Really appreciate it Tina!

MrHelloXD
Автор

Fascinating. You assumed each record was a unique request with a status of the request; I assumed every record was an action, meaning you would have one record for sending the request and a record with the request again but for the acceptance of the request.

Also, what you did with COUNT(CASE statement), I usually do with SUM(CASE statement). It never crossed my mind to use COUNT instead so that was cool. :D

wilsonman
Автор

IMO, the acceptance rate would be "accepted/sent" per day not accepted/total -> that would be the average acceptance per day. I love your walkthroughs.

inkuban
Автор

Tina please upload more such videos on mysql interview questions these are very helpful and knowledgeable. Why you have stopped posting them please start again.

agrim
Автор

Loverly walkthrough! Thansk for the shoutout, it's so great to be part of the community :)

AndrewMoMoney
Автор

would love to see day in life type of video just to get an idea on how u spend ur day as a data scientist

abdessamadbaahmed
Автор

Hi Tina, glad to see your 2nd SQL interview video. I am very excited that you put them in a going series and I am looking forward to following along. Would the real SQL interview questions are at this level of difficulty? Or would that be harder(ie. like those metric questions)?

danielw
Автор

Awesome; I really enjoy these practical videos! :)




(also congrats on getting a thousand subscribers! 🥳)

larigiba
Автор

Hi Tina, Thanks for making this video it is super helpful, I actually paused the video and solved my own first. There is just one difference from my solution to yours I hope we could discuss-
i.e. I did acceptance rate = total_accepetd/total_sent
my query -
select ds, case when sent 0 then NULL else accepted/sent end as acceptance_rate
from
(select ds, countcase when accepted then 1 else 0 end as accepted, count(case when sent then 1 else 0 end) as sent
from frd_req
group by 1)

shrutis.tiwari
Автор

Thank you so much for your interview questions!
I have an interview in a few days and even though I have 4 years of experience I still need to know what is asked in interviews
Your videos are really helpful!

_CodeLife_
Автор

Thank you!

Select ds,
count(case when action=‘accept’ THEN 1 ELSE null end)*1.00/count(action)*100 AS acceptace_rate
From friend_request
GROUP BY 1

jieerchen
Автор

i really need more of this!!! thanks so much Tina

trucquynhpham
Автор

Great video Tina! Quick question/confirmation, does the denominator "count(action)" make the assumption that we are ok double counting a friend request? As in, if a friend request was sent, and then accepted, "count(action)" counts that friend request twice?

yellowburros
Автор

Can you also do sum(case when action = 'accepted' then 1 else 0 end)? Or is null) more efficient?

WashingMykale
Автор

great as usual, keep going with this kind of videos whenever u can :)

BBBBBBAAAl
Автор

I just found your channel. I love the reverse engineering approach. Thanks Tina

edpalen
visit shbcf.ru