I was asked this question in a recent interview, and I believe I have nailed it, but I would like to know from this group what they would have done to solve this!

SELECT DISTINCT email, COUNT(*) AS duplicate_count
FROM users
GROUP BY email
HAVING COUNT(*) > 1;

⚠️ Something feels... off.

Can you spot the bug and explain what’s wrong with this query?

like
Posting as :
works at
You are currently posting as works at

Shouldn't the having be having duplicate_count > 0 since we want it grouped by email and the query already has count(*).

Thats the correct answer🙌🏻

Try CTE and try to break down the distinct and group by if affirmation is what you are looking for. Do group by in the first CTE and select distinct in the second. But this is redundant. It depends on the data you are dealing with and the surety you are looking for. Also, if the table is too big in size, use filters.

Hmmm! You can do that, but with the given example, a simple solution is expected

Related Posts

Travel and TTC combo haven’t worked. After 6 months, the only offer I got included 4 weeks paid and FLMA only after 1 year. So 1) go and risk laughable benefits or 2) stay but risk TTC. So shitty 😭

like

A Delta flight I took from the US to the EU a few months ago was delayed 24 hours (of which I spent at the airport) and when I asked for a refund for the $1300 ticket they declined and offered a $150 gift card 😂🥴🙃

like

Hi All, I am 11 yoe, working at a medium sized product company and I got an offer from Thoughtworks (50% hike) for a Lead Consultant role in data engineer profile.

Being a mother, I have anxiety and nervousness about joining a service based company bcoz of doubts below.
1. Job security, considering the upcoming recession is it safe to join TW at this time?
2. How good is WLB at TW for a Lead Consultant? Approx working hours on a daily basis?
3. How flexible is TW for WFH?

Please suggest

like
like

I have recently received offer from jpmc as an associate of consumer and community banking, that means job grade will be 601?

like

Hiring BA, PM, Sr Tech PM, and experienced Program Managers for EPMO. Hybrid schedule. Healthcare environment. Central IL location.

like

My team is working on some **hot**jobs in aerospace and med device! Sr quality engineers. Director Continuous Improvement. Inbox for details or follow us on linked in @elitetalentpartners

like

Hello!
U-R-G-E-N-T
URGENT need for (14) Business Analyst local to or would be willing to relocate to AZ.
Client: State of AZ
Deadline: 12/7/2022
Start Date: 1/9/2023

like

Any insight into Willkie NY culture? Would be going into corporate.

like

Looking for info on the Meta Reality Labs Global Marketing team, specifically Meta Quest. Have an offer and would like to get the real scoop on WLB/team culture. Does anyone work there, have a friend there, or have the deets? Happy to DM, too. ☕️🫖

like

https://www.linkedin.com/feed/update/urn:li:activity:6509784815112376320

Laughable considering their lack of women at the CD Level.

like

Getting paid $52/hour as a part-time employee. My supervisor wants to convert me into a contractor. What should my hourly rate be now? No benefits or PTO.

like
like

Wondering if anyone can share the approximate timeline after applying to Target Corp. to hearing something from them. Applied 9/1 and on the applicant portal the status still says “in progress.” I got a great internal referral, but I’ve not reached out to the hiring manager. 😬 I know there were a few hundred applicants — what’s a realistic timeline and what could I say to the hiring manager if I reach out to them. Many thanks.

like

For those who came to London thru their firm’s global mobility program, what sort of visa did you get? And was it a route to settlement? (IE did that time count towards getting ILR eventually)?

What resources would you recommend to find a full time nanny in Houston? Any specific websites, services, groups or places that have worked for you in the past?

like

I received an offer from a boutique litigation firm and a large law firm on the same day! I want to take a little time to consider both. What’s the typical time frame to respond?

like

Hi Fishes, what is your approach of value adding to your project on top of regular work? By the way I am a test lead(automation) and have 11 yoe in a product company.

What’s reasonable rent for a decent 1bdr in Hell’s Kitchen? I want enough room for a wfh desk not in my bedroom

like

Additional Posts in Data Analytics & Data Science

How do you know your value? Throughout my 10 yrs of being in a professional setting, I've had colleagues from various places of employment say, I don't think you know your worth. You're under valued, etc. What exercises/tools have helped you realize your worth and effectively advocate for it? TIA!

like

This bowl is crickets and I think we should make it much bigger. Anybody have any ideas how to get more people in his bowl?

like

Would like some opinions about how likely it is to make product analytics self serve by PMs? Anybody have success here? Or is it hopeless to think that product managers can pull their own data, look at their own dashboards, and do basic data tasks themselves?

like

Can anyone please share what salaries for Data Analysts are like in Bangalore, India for someone with about 2-4 years experience? Roughly how much per year can Data Analysts for large organizations expect to make?

like

I like to pursue in the data science field. I have business Analyst experience but to switch to data science field could you guide me on what should I learn? Where should I start?

like

Here is my go-to interview question, "What is the difference between data science and data analytics?"

What questions does everyone else include when interviewing or is the best question you've been asked in an interview?

like

Does anyone here have experience building product analytics? I am the first product analyst in my team and I work with approximately 6 PMs. Any help is appreciated

like

Where are good companies to apply for to get into data science? My offer right now for data science in the big4 is only 66k and I definitely can’t go that low. Industrial engineering background with experience in analytics.

like

Hi all,
I graduated during Covid with a double major in business administration and business management with a minor in marketing and magically ended up in sales because I needed a job. I’m about to take a data analytics course to make an attempt to break into that field. I’m currently looking for a mentor to help guide me during this time. Also, if anyone is willing to look over my resume and give me tips on how to make it more presentable for recruiters in DA that would be very helpful. Thanks

like

I’ve got about 20 years cross channel experience in marketing, split between big brands and startups, and I’m considering pivoting into a data science/data analyst role. I know it will initially be a step back in comp but is it at all realistic for a person with certificate level experience in data analysis but a decent marketing management background to expect $150-200k comp or is that mostly for degreed candidates (or not realistic at all)? Any guidance here is greatly appreciated.

like

Does anybody here do any side work for extra income using their data expertise? I would love ideas that I could do from ~5-15 hours a week. Tutoring is the only thing that comes to mind immediately. Thanks in advance!

helpful

Good morning, hope everyone is having a great week! Does anyone have any advice on breaking into an analyst role? I am currently a Senior Customer Success Manager, with a background in Operations/Process and Project Management as well. I have always enjoyed the analysis pieces of my roles and would love to expand my skills to show how qualified for a position in data analytics. Thank you in advance for the help!

like

What is the market like for entry level data scientists/ data analyst. I have a graduate certificate in data science and have spent the last 27 years as a mainframe dev so I have great SQL skills.

like

How many folks here have gone from data science into ML? And how many folks here have gone from data science into product management, or want to? Would love to hear some views here about career paths for data science people.

like

I have 5 YOE in Analytics... always thought I wanted to be a DS, but every job (even the junior ones) required experience in ML development. Though I am part of the ML project, I'm not the person develop the model. And I have a hard time when the interviewer ask about how I develop the model and what hyperparameters I tuned. I know the thought process and stuff but 'I' wasn't the one who did that part in the project. How to convince them that I could do the job without taking credit of others.

like

Hi , I recently started preparing for " data analyst" course. I have masters degree in computer science and 2 years experience as business analyst. Currently I'm on a career break of almost 7 years and trying to get back into IT as a data analyst now.
I started doing a course on coursera " Google data analytics certificate " . I'm not sure how to get back into job market. Please suggest any courses or road map to entry level data analyst jobs?

like

New to Fishbowl?

Download the Fishbowl app to
unlock all discussions on Fishbowl.
That was just a preview…
Sign Up to see all discussions
  • Discover what it’s like to work at companies from real professionals
  • Get candid advice from people in your field in a safe space
  • Chat and network with other professionals in your field
Sign up in seconds to unlock all discussions on Fishbowl.

Already a user?
Login here

Share

Embed this post

Copy and paste embed code on your site

Preview

Download the
Fishbowl app

See what’s happening in your industry
from the palm of your hand.

A phone with Fishbowl app

Scan your QR code to download
Fishbowl app on your mobile

Download app

Sign up for free to view this conversation on Fishbowl

By continuing you agree to Terms of Use and Privacy Policy

Already have an account? Log in

Sign up for free to continue using Fishbowl

By continuing you agree to Terms of Use(New) and Privacy Policy(New)
Messaging rates may apply

Already have an account? Log in

For account settings, visit Fishbowl on Desktop Browser or

General

Legal