Member-only story

Teams Power Users — Microsoft Asked SQL Question

Solving SQL Question asked by Amazon

Suraj Mishra
3 min readNov 6, 2022
Photo by Caspar Camille Rubin on Unsplash

Introduction

  • In this article we will solve Teams Power Users SQL question which is asked by Microsoft as per DataLemur website.

If you don’t know DatLemur then please do visit , it’s one of the best website to practice SQL questions and improve your SQL skills.

Question

  • We have been given messages table which contains message_id, sender_id along with other columns.
  • We have to find power users who sent most message in month of august in year 2022.
  • Our output contains total message count for each power user, we have to output top 2 users.

Solution

  • Since we need to output total number of messages sent by each user, that makes clear that we need to use group by sender and count message_id on that group.
  • This would return below…

--

--

Suraj Mishra
Suraj Mishra

Written by Suraj Mishra

Staff Software Engineer @PayPal ( All opinions are my own and not of my employer )

No responses yet