728x90

Data & BI/SQL Coding Test 4

[LeetCode](중급) 176. Second Highest Salary

문제Column NameTypeidintsalaryint[Table : Employee]id is the primary key (column with unique values) for this table.Each row of this table contains information about the salary of an employee. Write a solution to find the second highest distinct salary from the Employee table. If there is no second highest salary, return null 주어진 Employee 테이블에서 두 번째로 높은 급여를 조회해라. 두 번째 급여가 없다면 null을 조회해라. 풀이SELECT..

[LeetCode](초급) 182. Duplicate Emails

문제Column NameTypeidintemailvarchar[Table : Person]id is the primary key (column with unique values) for this table.Each row of this table contains an email. The emails will not contain uppercase letters. Write a solution to report all the duplicate emails. Note that it's guaranteed that the email field is not NULL.주어진 테이블에서 중복된 이메일을 출력해라. 풀이SELECT DISTINCT(ABC.email)FROM (SELECT email, COUNT..

728x90