1811. Find Interview Candidates
https://leetcode.com/problems/find-interview-candidates
Description
Table: Contests
Table: Users
Write an SQL query to report the name
and the mail
of all interview candidates. A user is an interview candidate if at least one of these two conditions is true:
The user won any medal in three or more consecutive contests.
The user won the gold medal in three or more different contests (not necessarily consecutive).
Return the result table in any order.
The query result format is in the following example:
Follow up:
What if the first condition changed to be "any medal in
n
or more consecutive contests"? How would you change your solution to get the interview candidates? Imagine thatn
is the parameter of a stored procedure.Some users may not participate in every contest but still perform well in the ones they do. How would you change your solution to only consider contests where the user was a participant? Suppose the registered users for each contest are given in another table.
ac
Last updated
Was this helpful?