0% found this document useful (0 votes)
64 views8 pages

SQL Challenges: Scenario Based Data Challenges With Solutions

The document contains an introduction to a series of SQL challenges and their solutions prepared by Rajanand Ilangovan. It describes 10 different SQL challenges related to tasks like cricket team selection, identifying consistent performers, determining possible travel orders between cities, ungrouping a table, and custom sorting a country dropdown. The challenges are meant to test scenario-based data problems. Readers are directed to download the full set of challenges and solutions from the provided link.

Uploaded by

apoorvnig
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views8 pages

SQL Challenges: Scenario Based Data Challenges With Solutions

The document contains an introduction to a series of SQL challenges and their solutions prepared by Rajanand Ilangovan. It describes 10 different SQL challenges related to tasks like cricket team selection, identifying consistent performers, determining possible travel orders between cities, ungrouping a table, and custom sorting a country dropdown. The challenges are meant to test scenario-based data problems. Readers are directed to download the full set of challenges and solutions from the provided link.

Uploaded by

apoorvnig
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

aapoorv.nigam@gmail.

com 17 Feb 2023

FREE
SAMP
LE

SQL
CHALLENGES
Scenario based data challenges with solutions

Rajanand Ilangovan
download.rajanand.org
[email protected] 17 Feb 2023

Table of Contents

01. Cricket team selection


02. Consistent performer
03. Traveller's dilemma
04. Ungroup table
05. Country dropdown
06. Employees earn more than their manager
07. Employees earn more than their BU average
08. Employees earn more than their peers
09. Managers and direct reports
10. Travel hours
[email protected] 17 Feb 2023

SQL CHALLENGES
Prepared by Rajanand Ilangovan

01. CRICKET TEAM SELECTION

Question:
The Indian Premier League (IPL) is planning to start
a new T10 series and want to launch a pilot quickly.
The management wants to select the players into
three teams randomly instead of auction.

Write an SQL query to randomly group players into


three teams. Each team should have one all rounder,
spin bowler, and wicket keeper and two batsman, and
fast bowler.

Download SQL challenges and solutions at download.rajanand.org


[email protected] 17 Feb 2023

SQL CHALLENGES
Prepared by Rajanand Ilangovan

02. CONSISTENT PERFOMER

Question:
You have two tables called players and score_details.
The player table contains player detail and
score_details table contains each innings the players
have played and runs scored.

Write an SQL query to list out the players who have


consecutively scored 30+ runs at least 3 times.

Download SQL challenges and solutions at download.rajanand.org


[email protected] 17 Feb 2023

SQL CHALLENGES
Prepared by Rajanand Ilangovan

03. TRAVELLER'S DILEMMA

Question:
You are planning to go for a summer vacation and
decided on the cities you want to visit. But you have
not finalized in which order you want to visit them
yet.

Write a SQL query to list out all different possible


order you can visit these cities.
Note that you neither want to visit the same city
again nor skip any city in your travel plan.

Download SQL challenges and solutions at download.rajanand.org


[email protected] 17 Feb 2023

SQL CHALLENGES
Prepared by Rajanand Ilangovan

04. UNGROUP TABLE

Question:
You have an orders table with orders details. You
have to ungroup the data based on the order
quantity. The amount column in the output should be
an amount of a single quantity.

Assume that the product's amount will be same


regardless of the quantity ordered.

Write an SQL query to degroup the orders table.

Download SQL challenges and solutions at download.rajanand.org


[email protected] 17 Feb 2023

SQL CHALLENGES
Prepared by Rajanand Ilangovan

05. COUNTRY DROPDOWN

Question:
There is a retail company in US which majorly serves
customers in US, UK and Canada. They want the
shipping country drop down in the web application to
list the countries in the below order.
US, UK, Canada and rest of the countries they serve
in ascending order.
Write an SQL query to sort the dropdown country
value in custom order.

Download SQL challenges and solutions at download.rajanand.org


[email protected] 17 Feb 2023

FRE
with E sam
solu ple
tion
s

Interested in solution?

DOWNLOAD NOW

link.rajanand.org/sql-challenges

You might also like