SQL : Find Records With Duplicate email | emails Connecting Multiple Users

Опубликовано: 06 Октябрь 2024
на канале: Grow with Data
150
11

Video 21: Given a set of user id and emails, find the emails which are duplicated. In other words, we have to find the emails which are connecting more than one users. In this video, we discussed the solution in three approaches
1. The brute force method is a self join approach where you connect those tables based on email and the user id should not be the same. If you need to show the email with all the users its connected to, then you have to use the CTE table or a subquery.
2. The use of aggregate function and filter the duplicates using HAVING clause is the next approach. In this approach, we discussed the possibility of making mistakes on allowing duplicates and how to address that
3. Using the windows function count(*), how to get the duplicate email address and the impact of including ORDER BY in the partition clause.

code: https://github.com/jeganpillai/sql_re...

Video on "Count of Messages Between Users" :    • SQL : Count of Messages Between Users  

Follow me on,
Website : https://growwithdata.co/
YouTube :    / @growwithdata  
TikTok :   / growwithdata  
LinkedIn :   / growwithdata  
Facebook :   / growwithdata.co  
twitter :   / growwithdata_co  
Instagram :   / growwithdata.co  
WhatsApp : https://whatsapp.com/channel/0029VaF8...

#sql #dataengineers #tablejoins #ceil #floor #bucket #meta #google #facebook #apple #paypal #netflix #amazon #deinterview #sqlinterview #interviewquestions #leetcode #faang #maanga #mysql #oracle #dbms #query #sqlserver #mysql #coderpad #aggregates #aggregation #nonaggregation #database #placementpreparation