Dorito
'알고리즘/SQL-1' 카테고리의 글 목록

알고리즘/SQL-1

알고리즘/SQL-1

[리트코드 SQL Medium] 178. Rank Scores

Rank Scores - LeetCode SELECT score, DENSE_RANK() OVER (order by score DESC) as 'rank' FROM Scores; DENSE_RANK() 는 함수이기때문에, 컬럼 alias 를 쓰고 싶을 경우 문자열로 지정해줘야 한다. * SQL 윈도우 함수에 대해서 더 복습하기

알고리즘/SQL-1

180. Consecutive Numbers

링크: 180. Consecutive Numbers 난이도: Medium 문제 Table: Logs +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | num | varchar | +-------------+---------+ id is the primary key for this table. id is an autoincrement column. Write an SQL query to find all numbers that appear at least three times consecutively. Return the result table in any order. The query result..