Data Interview Qs - Top keywords and advertisers


Top keywords and advertisers

SQL Database Querying Window Function Subquery Self-Join

Forward this email to a friend or colleague and challenge them to solve it.


You're given the following table that shows spend by keyword, advertiser, and unique ad ID:

Table: keyword_summary

keyword ad_id advertiser_id total_spend
bicycle 1243213 1234 95
bike 1243213 1234 71
bike tires 1243213 1234 22
bike breaks 1243213 1234 95
bike accessories 1243213 1234 28
... ... ... ...

Using the table above, write a SQL query that returns each keyword along with the advertiser_id of the top spending advertiser, and total spend on the keyword (agnostic of advertiser). Sort the results in descending order by the total spend on the keyword.

You can view/query the data in an interactive SQL fiddle here.


You’ve accumulated 349 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.

Was this email forwarded to you? You can join our list here to receive questions

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Key phrases

Older messages

Survival time of heart patients

Wednesday, September 21, 2022

Python, Pandas, Data Visualization, Probability Distribution, Goodness of Fit, Maximum Likelihood Estimate, InterviewQs Survival time of heart patients Python Pandas Data Visualization Probability

Customized probability function

Monday, September 19, 2022

Python, Algorithms, Probability, Loops, Resampling, InterviewQs Customized probability function Python Algorithms Probability Loops Resampling Forward this email to a friend or colleague and challenge

Student exam scores

Friday, September 16, 2022

Statistics, Probability, Sampling, InterviewQs Student exam scores Statistics Probability Sampling Forward this email to a friend or colleague and challenge them to solve it. Hi, Suppose a hundred

Maximum total compensation

Thursday, September 15, 2022

SQL, Database Querying, Window Function, Subquery, Self-Join, InterviewQs Maximum total compensation SQL Database Querying Window Function Subquery Self-Join Forward this email to a friend or colleague

5-year changes in candy production

Monday, September 12, 2022

Data Analysis, Python, Pandas, Statistics, T-test, External Dataset, InterviewQs 5-year changes in candy production Data Analysis Python Pandas Statistics T-test External Dataset Forward this email to

EXCLUSIVE: New to VC+ This Month 🏆

Friday, October 7, 2022

We're offering a special gift for new members over the next 4 days only. View email in browser What's New on VC+ in October? If you're a regular visitor to Visual Capitalist, you know that

📲 AI vs. Algorithms

Friday, October 7, 2022

Algorithms can be regarded as the essential building blocks that make up AI The IT Scoop, brought to you by TechnologyAdvice Friday, October 07, 2022 TOP STORY AI vs. Algorithms AI vs. Algorithms

H+ Weekly - Issue #383

Friday, October 7, 2022

Tesla shows a humanoid robot; DeepMind finds a better way to multiply matrices; a new project to map the entire human brain launches; and more! . H+ WEEKLY . Issue #383 View this email in your browser

You're invited -- delight customers, product lessons, prioritization, growth

Friday, October 7, 2022

How delighting customers can go awry and what to do instead Wednesday, October 19th @ 1:00 PM EST We've learned that the key to building successful products is to iterate quickly and see what

Made by Google: Everything Announced at the Pixel 7 Launch Event

Friday, October 7, 2022

Read in Browser Logo for Review Geek October 7, 2022 The next generation of Google Pixel devices is finally here. Pre-orders opened for the Pixel 7 smartphone and Pixel Watch shortly after the exciting

Results of anonymous function

Friday, October 7, 2022

Python, Algorithms, Data Structures, Arrays, Anonymous Functions, InterviewQs Results of anonymous function Python Algorithms Data Structures Arrays Anonymous Functions Forward this email to a friend

Testing Google’s new Pixel 7 phones

Friday, October 7, 2022

The Morning After Now available on your smart speaker and wherever you get your podcasts Apple Podcasts | Spotify | Google Play | iHeart Radio It's Friday, October 07, 2022. Google started teasing

📝 Guest post: Key Challenges To Automated Data Labeling and How To Overcome Them*

Friday, October 7, 2022

In this guest post, Superb AI presents several common roadblocks that ML teams might face on their journey to adopting automated data processing practices and providing actionable solutions to those

ASP.NET Core News - 10/07/2022

Friday, October 7, 2022

View this email in your browser Get ready for this weeks best blog posts about ASP.NET Core! This newsletter is sponsored by - the most advanced, yet so simple to set up, error logging and

Your weekly Notion templates #60

Friday, October 7, 2022

3 new templates + the best resource for Notion formulas 🔥 ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌