FAANG SQL Interview Question! | Leetcode 182 - Duplicate Emails

preview_player
Показать описание
dynamic programming, leetcode, coding interview question, data structures, data structures and algorithms, faang
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

When you’re more comfortable w SQL than Java and other OOP languages rn 😭😂

rileyfuller
Автор

One question that I've become quite familiar with from watching all your videos is related to my expertise as a database administrator, so that was an easy one for me. Although I'm still a Python beginner, I plan to watch more of your videos repeatedly to enhance my skills and develop a mindset similar to yours

bssandeep
Автор

there is absolutely no way it’s this easy my mind is melting from doing C for 3 semesters😭

francescopayan
Автор

There was a Primegen reacts video where someone destroyed their prod database because they had whitespace like you do here. Basically it ignored the where clause and just deleted everything because there was an empty new line before the where clause

FunkyELF
Автор

There's many solutions for this, this is the most efficient.

I'm not as efficient 😂 and I've been dealing with partitions for a while, so the first I thought:

select distinct
a.email


from
(
select
email,
count(email) over (partition by email) as emailcount

from
person
)a

where a.emailcount > 1

lilyvaldis
Автор

Posting something so that I'll see more SQL content in the future.

HarmonicaTool
Автор

What site does he get the questions from? Does anyone know?

matheusspable
Автор

If there were any indexes, would they have been respected since you used a sql native function?

Frome
Автор

It would be interesting to know how this performs to a left anti join with itself.

Pilikio
Автор

Is it possible to do this with a where?

leonardocontreras
Автор

My data administration class is exponentially harder than this lol

JustinLietz
Автор

Didn't even need the template you put out... I really did too much sql...

ndchunter
Автор

if NULL was included "where" is the helper

cnkumar
Автор

I am new to sql, so this query: 1) Is sql table, column names case insensitive because code uses Email but problem mentioned email...
2) Isn't any sql statement needed to return the column id and email of the duplicates ?

ajitsdeshpande
Автор

My idea before I watch the solution 😂

We could GROUP BY emails in a subquery and have a count(iDs) then query that for all emails that have count > 1.

Edit:
Ahh, I forgot about the HAVING keyword 😂

Cewu
Автор

cant you do something like this?
SELECT DISTINCT Email FROM Person;

davidskulj