Data Interview Qs - Maximum total compensation

InterviewQs

Maximum total compensation

SQL Database Querying Window Function Subquery Self-Join

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

Hi, 

You're given the following table showing information about employees at a company:

Table: emp_info

department emp_id salary_annual bonus
eng 1234 150000 20000
eng 1235 125000 15000
eng 1236 110000 17000
sales 4454 110000 25000
sales 4432 145000 7000
marketing 4430 130000 12000
marketing 1299 135000 18000

Using the table above, write a SQL query to return the emp_id of the employee with the highest total compensation. Make sure your query is able to handle potential ties (e.g. if there is a tie, should return all emp_ids that tie for the highest total compensation).

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


 

You’ve accumulated 345 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

Older messages

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

Programming the Tower of Hanoi

Friday, September 9, 2022

Python, Algorithms, Loops, Recursion, InterviewQs Programming the Tower of Hanoi Python Algorithms Loops Recursion Forward this email to a friend or colleague and challenge them to solve it. Hi, The

Probability of a robbery

Wednesday, September 7, 2022

Probability Theory, Probability Reasoning, Complement Rule, InterviewQs Probability of a robbery Probability Theory Probability Reasoning Complement Rule Forward this email to a friend or colleague and

Checking user retention and churn in SQL

Monday, September 5, 2022

SQL, Database Querying, Window Function, Subquery, Self-Join, InterviewQs Checking user retention and churn in SQL SQL Database Querying Window Function Subquery Self-Join Forward this email to a

Price per calorie of various snack foods

Friday, September 2, 2022

Data Analysis, Python, Pandas, Data Manipulation, InterviewQs Price per calorie of various snack foods Data Analysis Python Pandas Data Manipulation Forward this email to a friend or colleague and

Google reinvents search 🔎, Amazon Kindle Scribe 📖, Cloudflare's CAPTCHA killer 🤖

Thursday, September 29, 2022

Google showed off a bunch of new ways for people to search the internet at its annual Search On event. Sign Up | View Online | Sponsor Daily Update 2022-09-29 Drata is Security and Compliance on

[Python Mastery] The secret to "ethical self-promotion"?

Thursday, September 29, 2022

Hey there, Here's some food for thought: There's a difference between *doing* a great job as a Python developer, and *to be seen doing* a great job. Being a skilled developer among peers—and

[Python Dependency Pitfalls] Artisanal "from-scratch" development

Thursday, September 29, 2022

Hey there, The other day I got this question from Newsletter member Newvick in my email inbox: ~~~ I'm trying to get past the beginner's stage in Python and one problem I have is: When do you

[Sublime + Python Setup] The Ctrl+s "Heisenbug"

Thursday, September 29, 2022

"What the **** is going on?!" I heard Keith yell. Returning from my lunch break and in a helpful mood I grabbed my coffee mug and shuffled over to my coworker's desk. "What's

NEW Laravel Daily with even more content!

Thursday, September 29, 2022

Hey hey, This newsletter issue is important for me, as I've relaunched my good old blog, watch/read the details below. So, from now on, this newsletter will include not only my daily videos but

Register Today: Best practices for building Kibana dashboards to explore your data

Thursday, September 29, 2022

Get the latest tips on how to build interactive dashboards in Kibana elastic | Search. Observe. Protect Best practices for building Kibana dashboards to explore your data Register now Date & Time

Integrating with Fastmail — and Ken Thompson really did launch his "trusting trust" trojan attack in real life

Wednesday, September 28, 2022

Issue #904 — Top 20 stories of September 29, 2022 Issue #904 — September 29, 2022 You receive this email because you are subscribed to Hacker News Digest. You can open it in the browser if you prefer.

Fast Company hacker sends 2 'obscene and racist' notifications to Apple News users

Wednesday, September 28, 2022

TechCrunch Newsletter TechCrunch logo The Daily Crunch logo By Christine Hall and Haje Jan Kamps Wednesday, September 28, 2022 With almost a hundred new stories on the site since the last Daily Crunch,

JSK Daily for Sep 28, 2022

Wednesday, September 28, 2022

JSK Daily for Sep 28, 2022 View this email in your browser A community curated daily e-mail of JavaScript news Designing & Implementing Access Control in React Almost all applications require users

Charted | 40 Years of Global Energy Production 📊

Wednesday, September 28, 2022

A snapshot of global energy production, and the major players that have produced the most fossil fuels, nuclear, and renewable energy since 1980. View Online | Subscribe Presented by: Explore beyond