본문 바로가기
728x90

Tests/Leetcode10

[leetcode] MySQL > 185. Department Top Three Salaries leetcode Database 185. Department Top Three Salaries SQL Schema & Explanation 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 | 85000 | 1 | | 2 | Henry | 80000 | 2 | | 3 | Sam | 60000 | 2 | | 4 | Max | 90.. 2020. 9. 11.
[leetcode] 177. Nth Highest Salary (MySQL) 문제. leetcode Database 177. Nth Highest Salary SQL Schema & Explanation Write a SQL query to get the nth highest salary from the Employee table. +----+--------+ | Id | Salary | +----+--------+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +----+--------+ For example, given the above Employee table, the nth highest salary where n = 2 is 200. If there is no nth highest salary, then the query should return nu.. 2020. 9. 10.
[leetcode] MySQL > 178. Rank Scores 문제. 178. Rank Scores SQL Schema & Explantion 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 should be no "holes" between ranks. +----+-------+ | Id | Score | +----+-------+ | 1 | 3.50 | | 2 | 3.65 | | 3 | 4.00 | | 4 | 3.85 .. 2020. 9. 9.
[leetcode] MySQL > 184. Department Highest Salary 문제. Leetcode SQL, 184. Department Highest Salary SQL Schema. The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id. +----+-------+--------+--------------+ | Id | Name | Salary | DepartmentId | +----+-------+--------+--------------+ | 1 | Joe | 70000 | 1 | | 2 | Jim | 90000 | 1 | | 3 | Henry | 80000 | 2 | | 4 | Sam | 60000 | 2.. 2020. 9. 8.
728x90