Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 6 3 3 . Percentage of Users Attended a Contest Easy Topics Companies SQL Schema Pandas Schema Table: Users + - - - -
Percentage of Users Attended a Contest
Easy
Topics
Companies
SQL Schema
Pandas Schema
Table: Users
Column Name Type
userid int
username varchar
userid is the primary key column with unique values for this table.
Each row of this table contains the name and the id of a user.
Table: Register
Column Name Type
contestid int
userid int
contestid userid is the primary key combination of columns with unique values for this table.
Each row of this table contains the id of a user and the contest they registered into.
Write a solution to find the percentage of the users registered in each contest rounded to two decimals.
Return the result table ordered by percentage in descending order. In case of a tie, order it by contestid in ascending order.
The result format is in the following example.
Example :
Input:
Users table:
userid username
Alice
Bob
Alex
Register table:
contestid userid
Output:
contestid percentage
Explanation:
All the users registered in contests and The percentage is and we sort them in the answer table by contestid in ascending order.
Alice and Alex registered in contest and the percentage is
Bob registered in contest and the percentage is
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started