Member-only story

User’s Third Transaction — SQL Questioned Asked By Uber

Solving SQL question asked by Uber

Suraj Mishra
2 min readOct 28, 2022

Originally Published in https://asyncq.com/

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 user_transactions input table. our goal is to find out 3rd transaction made by each user.

Solution

  • First we will partition uber_transaction table based on user_id, we will add row_number as column to rank each record.
  • Here is output.

--

--

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