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

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

Seattle Data Guy

2 года назад

48,246 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@vamshibokka9794
@vamshibokka9794 - 20.10.2023 14:55

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

Ответить
@davidoh6342
@davidoh6342 - 15.08.2023 17:56

Why not order by score and lead by 1 and get the diff? Cartesian join must be expensive

Ответить
@Chowmeingeejah
@Chowmeingeejah - 11.04.2023 23:42

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?

Ответить
@gatorpika
@gatorpika - 23.01.2023 06:44

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.

Ответить
@lloydwang8108
@lloydwang8108 - 28.08.2022 17:16

First solution may not work if data is unclean, eg if there actually existed a user but his id was accidentally stored as NULL

Ответить
@muhammadbadar6089
@muhammadbadar6089 - 14.08.2022 02:38

every time you mention naruto in a video. I pause it go like the video and then resume.

Ответить
@Eastmaniac
@Eastmaniac - 25.07.2022 16:51

It's funny to me how a lot of the SQL questions in interviews are things you'll never have to do in your day to day job.

They just find a leetcode problem and ask it. So dumb.

Ответить
@severlight
@severlight - 16.07.2022 18:39

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

Ответить
@asd855280
@asd855280 - 25.05.2022 00:42

Another great video, thank you.

Ответить
@coding3438
@coding3438 - 16.04.2022 14:15

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

Ответить
@coding3438
@coding3438 - 16.04.2022 14:02

Select distinct name from neighbourhoods where id not in ( select distinct meighborhood_id from users)

Ответить
@subimalkhatua2886
@subimalkhatua2886 - 16.04.2022 13:33

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

Ответить
@milanmiletic9819
@milanmiletic9819 - 16.04.2022 11:35

Thank u for this video 👋👋👋👋👋👋👋👋👋

Ответить
@remek5758
@remek5758 - 18.02.2022 15:50

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

Ответить
@brucehendry270
@brucehendry270 - 17.02.2022 00:54

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 😋

Ответить
@ajaxaj6749
@ajaxaj6749 - 16.02.2022 22:16

We can do partition by user name and song and use row _num=3 with order by asc. No need of group by CTE in 2nd question

Ответить
@karelhalim6967
@karelhalim6967 - 16.02.2022 14:11

Hello Ben, i've been following your data engineer roadmap, im still learning python, is it important to learn flask/django or any python web framework? Will it help me to understand data engineering better?

Ответить
@lokesh1505
@lokesh1505 - 16.02.2022 12:05

Lag or lead would work as well for the third problem

Ответить
@ronin2963
@ronin2963 - 14.02.2022 22:34

Why would you use SQL for this? Python or JS are much better suited for this type of operation.

Ответить
@GuyThompsonFWTX
@GuyThompsonFWTX - 14.02.2022 21:31

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.

Ответить
@iqjayfeng
@iqjayfeng - 14.02.2022 20:12

AMAZING VID!

Ответить
@iamkv
@iamkv - 14.02.2022 19:35

Great video, thank you Ben!!

Ответить
@ass2412
@ass2412 - 14.02.2022 08:14

Interview query is expensive. Is stratascratch good enough for product companies? I am thinking of getting that for practicing SQL.

Ответить
@carlitos4505
@carlitos4505 - 13.02.2022 23:46

I was always told by the senior engineers that using a SELECT DISTINCT is a sign of an inexperienced developer. But they never tell me why, could you possibly help me why that is?

Edit: Spelling

Ответить
@kedarjoshi5878
@kedarjoshi5878 - 13.02.2022 19:58

Most awaited video. Thanks for this👍

Ответить
@FebbyTV
@FebbyTV - 13.02.2022 17:49

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.

Ответить
@jsonify
@jsonify - 13.02.2022 09:38

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!!!

Ответить
@datakube3053
@datakube3053 - 12.02.2022 16:17

How much understanding of Data structure and algorithms is required to crack top product based companies

Ответить
@nanomartin
@nanomartin - 12.02.2022 14:09

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!

Ответить
@Alez101010
@Alez101010 - 12.02.2022 11:09

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

Ответить
@mirirshadali33
@mirirshadali33 - 12.02.2022 08:40

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.

Ответить
@kasinath640
@kasinath640 - 12.02.2022 05:35

I am new to coding and stuff , pls provide best source for learning the SQL.

Ответить
@shreykhetrapal9585
@shreykhetrapal9585 - 12.02.2022 03:31

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

Ответить
@BJTangerine
@BJTangerine - 11.02.2022 23:51

Love this kind of content, keep it up

Ответить
@KoldFiyure
@KoldFiyure - 11.02.2022 19:56

Can we do this with Python as well? I am a new data engineer that is trying to get to my next assignment. I need to hurry and upskill on Python by doing. I want to use this site youve used here to practice more SQL as well. I could never get good enough with SQL it seems.

Ответить
@naheliegend5222
@naheliegend5222 - 11.02.2022 19:47

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

Ответить
@rememberthename911g
@rememberthename911g - 11.02.2022 19:33

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

Ответить
@rememberthename911g
@rememberthename911g - 11.02.2022 19:03

For the first question, couldn't a specific neighborhood be null in one row but filled in another row?

Ответить
@hassaanali7405
@hassaanali7405 - 11.02.2022 18:29

Hey Ben! I hope you're extensively looking into the IBM Data Engineering Professional Certificate on Coursera, as it provides an end to end solution using everything from SQL to Airflow to basic Warehousing. Hoping for a video detailing this soon.

Ответить