0% found this document useful (0 votes)
18 views3 pages

15 Days of Learning SQL - HackerRank

Uploaded by

Rishi Chourasia
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)
18 views3 pages

15 Days of Learning SQL - HackerRank

Uploaded by

Rishi Chourasia
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/ 3

01/11/2024, 15:13 15 Days of Learning SQL | HackerRank

5
 

25 more points to get your next star!


15 Days of Learning SQL  Rank: 493570 | Points: 425/450
Sql

Problem Submissions Leaderboard

Julia conducted a days of learning SQL contest. The start date of the contest was March 01, 2016 and the end date was March 15, 2016.

Write a query to print total number of unique hackers who made at least submission each day (starting on the first day of the contest), and find the hacker_id and name
of the hacker who made maximum number of submissions each day. If more than one such hacker has a maximum number of submissions, print the lowest hacker_id.
The query should print this information for each day of the contest, sorted by the date.

Input Format

The following tables hold contest data:

Hackers: The hacker_id is the id of the hacker, and name is the name of the hacker.

Submissions: The submission_date is the date of the submission, submission_id is the id of the submission, hacker_id is the id of the hacker who made the

submission, and score is the score of the submission.

Sample Input

For the following sample input, assume that the end date of the contest was March 06, 2016.

https://www.hackerrank.com/challenges/15-days-of-learning-sql/problem 1/3
01/11/2024, 15:13 15 Days of Learning SQL | HackerRank

Hackers Table: Submissions Table:

Sample Output

2016-03-01 4 20703 Angela


2016-03-02 2 79722 Michael
2016-03-03 2 20703 Angela
2016-03-04 2 20703 Angela
2016-03-05 1 36396 Frank
2016-03-06 1 20703 Angela

Explanation

On March 01, 2016 hackers , , , and made submissions. There are unique hackers who made at least one submission each day. As each

hacker made one submission, is considered to be the hacker who made maximum number of submissions on this day. The name of the hacker is Angela.

On March 02, 2016 hackers , , and made submissions. Now and were the only ones to submit every day, so there are unique hackers

who made at least one submission each day. made submissions, and name of the hacker is Michael.

On March 03, 2016 hackers , , and made submissions. Now and were the only ones, so there are unique hackers who made at least

one submission each day. As each hacker made one submission so is considered to be the hacker who made maximum number of submissions on this day. The

name of the hacker is Angela.

On March 04, 2016 hackers , , , and made submissions. Now and only submitted each day, so there are unique hackers who

made at least one submission each day. As each hacker made one submission so is considered to be the hacker who made maximum number of submissions on

this day. The name of the hacker is Angela.

On March 05, 2016 hackers , , and made submissions. Now only submitted each day, so there is only unique hacker who made at

least one submission each day. made submissions and name of the hacker is Frank.

On March 06, 2016 only made submission, so there is only unique hacker who made at least one submission each day. made submission and name of

the hacker is Angela.

https://www.hackerrank.com/challenges/15-days-of-learning-sql/problem 2/3
01/11/2024, 15:13 15 Days of Learning SQL | HackerRank

MySQL   

1 ▾ /*
2 Enter your query here.
3 */

Line: 1 Col: 1

 Upload Code as File


Run Code Submit Code

Blog | Scoring | Environment | FAQ | About Us | Support | Careers | Terms Of Service | Privacy Policy

https://www.hackerrank.com/challenges/15-days-of-learning-sql/problem 3/3

You might also like