Leetsql 196: Delete Duplicate Emails

196. Delete Duplicate Emails Total Accepted: 18532 Total Submissions: 97924 Difficulty: Easy Contributors: Admin Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. +—-+——————+ | Id | Email | +—-+——————+ | 1 | john@example.com | | 2 | bob@example.com | …

Leetsql 182: Duplicate Emails

182. Duplicate Emails  Total Accepted: 27110 Total Submissions: 73222 Difficulty: Easy Contributors: Admin Write a SQL query to find all duplicate emails in a table named Person. +—-+———+ | Id | Email | +—-+———+ | 1 | a@b.com | | 2 | c@d.com | | 3 | a@b.com | +—-+———+ For example, your query should …

Leetcode 181: Employees Earning More Than Their Managers

https://leetcode.com/problems/employees-earning-more-than-their-managers/ 181. Employees Earning More Than Their Managers Total Accepted: 27138 Total Submissions: 76486 Difficulty: Easy Contributors: Admin The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. +—-+——-+——–+———–+ | Id | Name | Salary | ManagerId | +—-+——-+——–+———–+ | 1 …

Leetcode 178: Rank Score

https://leetcode.com/problems/rank-scores/ 178. Rank Scores  Total Accepted: 13824 Total Submissions: 58154 Difficulty: Medium Contributors: Admin Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value. In other words, there …

Leetcode 262: Trips and Users

262. Trips and Users Total Accepted: 6774 Total Submissions: 43127 Difficulty: Hard Contributors: Admin The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at the Users table. Status is an ENUM type of (‘completed’, ‘cancelled_by_driver’, ‘cancelled_by_client’). +—-+———–+———–+———+——————–+———-+ | Id | …

Leetsql 185: Department Top Three Salaries

185. Department Top Three Salaries Total Accepted: 8926 Total Submissions: 57724 Difficulty: Hard Contributors: Admin The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id. +—-+——-+——–+————–+ | Id | Name | Salary | DepartmentId | +—-+——-+——–+————–+ | 1 | Joe | 70000 | 1 …