SQL Interview Questions For Data Scientists And Data Engineers - Tips For Practicing SQL Interviews

preview_player
Показать описание
SQL has become a common skill requirement across industries and job profiles over the last decade.

Companies like Amazon and Google will often demand that their data analysts, data scientists and product managers are at least be familiar with SQL. This is because SQL remains the language of data.

So, in order to be data-driven, people need to know how to access and analyze data.

With so many people looking at, slicing, manipulating, and analyzing data we wanted to provide some tips to help improve your SQL.

InterviewQuery

If you enjoyed this video, check out some of my other top videos.

What Skills Do Data Engineers Need?

Data Engineering Project Ideas

If you want to learn more about machine learning, check out DataCamps Machine Learning Course

If you'd like to read up on my updates about the data field, then you can sign up for our newsletter here.

Or check out my blog

Tags: Data engineering projects, Data engineer project ideas, data project sources, data analytics project sources, data project portfolio

0:00 Intro
1:01 Question 1 Answer 1
3:13 Question 1 Answer 2
4:56 Question 2
10:59 Question 3

_____________________________________________________________
_____________________________________________________________
About me:
I have spent my career focused on all forms of data. I have focused on developing algorithms to detect fraud, reduce patient readmission and redesign insurance provider policy to help reduce the overall cost of healthcare. I have also helped develop analytics for marketing and IT operations in order to optimize limited resources such as employees and budget. I privately consult on data science and engineering problems both solo as well as with a company called Acheron Analytics. I have experience both working hands-on with technical problems as well as helping leadership teams develop strategies to maximize their data.

*I do participate in affiliate programs, if a link has an "*" by it, then I may receive a small portion of the proceeds at no extra cost to you.
Рекомендации по теме
Комментарии
Автор

Damn, been writing SQL for years and just starting to use more CTEs in the past year instead of subqueries, but never realized that you could make the second query dependent on the results of the first. That's huge! Clicked all the thumbs and bells and stuff.

gatorpika
Автор

SQL is so underrated. Could not imaging how do to my job without it.

naheliegend
Автор

Great vid.
One minor thing - please don't teach people to name their CTEs t1, t2, t3 etc or alias their tables in joins with t1, t2, t3.

In my opinion you should always try to give the CTEs names that somewhat can explain whats going on.

FebbyTV
Автор

Thanks for putting this out. I heard you on Ken's Nearest Neighbors this past week and it was great to hear more of your backstory. Seattle for the win!!!

jsonify
Автор

Personal nit-picky thing, I think in learning and training it's a really good practice to use 'AS' to show that you're using an alias. Again, this isn't something you need to do all the time, but for those unfamiliar with writing and reading SQL, I think it's a big help in understanding the syntax.

GuyThompsonFWTX
Автор

This is really coool. I like the 1st problem you solved using group by clause. it never occur to me before. I hope you will continue to publish more sql problems.

mirirshadali
Автор

I really liked this one, more than others! Didn't know about that site. I'll use it for sure. And seeing that, kind of, practical class, helps me a lot figure out something that maybe I didn't know so far.
Thanks Ben!

nanomartin
Автор

for second question you could have easily used a mix of dense_rank and row_number dense_rank() over(partition by user_id order by song_id) r_in_sng, row_number () over(partition by user_id, song_id order by created_at) r_in_grp where r_in_sng = 3 and r_in_grp = 1

subimalkhatua
Автор

Hey, a pleasure to watch you, thanks for the practice source

severlight
Автор

This was really helpful, specially the join on last problem was a fantastic approach

shreykhetrapal
Автор

Love this kind of content, keep it up

BJTangerine
Автор

As always, very useful video! Thank you!! Just getting my DE interview on Wednesday 🙄🙄

Alez
Автор

For the third question we can order by the scores and then use lead() or lag() function to compare the scores

vamshibokka
Автор

What i love about this Interview questions is that no one will ever have a working scenario for such dumb tasks x

remek
Автор

second question now requires returning users who dont have a third song with 'null' for column song and data.. for this you can replace join on second cte to a right join

rvian
Автор

Minor detail - but your question 1 answer 1 assumes that u.id is non-null (which it should be as an id column)

SA
Автор

For the last example why not self join onto the rank ordered by score? i.e. join rank(score) = rank(score) - 1 and then calculate the difference of the scores. Wouldn't a cross join be too resource intensive?

Chowmeingeejah
Автор

I would have answered the first question with a not exists as it's probably the easiest to read and understand what the code is supposed to be doing, good job on the other two questions, I'll have to have a look at the site and have a play myself 😋

brucehendry
Автор

The third question about the SAT would’ve been achieved by lead lag functions as well right?

coding
Автор

How does the order by 3, 2, 1 select the student combination that is higher in the alphabet?

rememberthenameg