SQL | HackerRank 가장 짧고 긴 도시 이름 찾기 – 문자열 길이 기반 SQL 정렬과 조건 추출
·
Computer Science/SQL
Query the two cities in STATION with the shortest and longest CITY names, as well as their respective lengths (i.e.: number of characters in the name). If there is more than one smallest or largest city, choose the one that comes first when ordered alphabetically. The STATION table is described as follows:where LAT_N is the northern latitude and LONG_W is the western longitude.ExplanationWhen or..
SQL | HackerRank 삼각형 분류하기: 조건문 CASE를 활용한 다중 조건 처리
·
Computer Science/SQL
Write a query identifying the type of each record in the TRIANGLES table using its three side lengths. Output one of the following statements for each record in the table:Equilateral: It's a triangle with sides of equal length.Isosceles: It's a triangle with sides of equal length.Scalene: It's a triangle with sides of differing lengths.Not A Triangle: The given values of A, B, and C don't for..
SQL | LeetCode 1327. 특정 월 기준 주문량 분석하기
·
Computer Science/SQL
Table: Products+------------------+---------+| Column Name | Type |+------------------+---------+| product_id | int || product_name | varchar || product_category | varchar |+------------------+---------+product_id is the primary key (column with unique values) for this table.This table contains data about the company's products. Table: Orders+---------------+---------+| Col..
SQL | LeetCode 1484. 날짜별로 팔린 제품들 정리하기 (GROUP BY + 정렬 + 문자열 조합)
·
Computer Science/SQL
Table Activities:+-------------+---------+| Column Name | Type |+-------------+---------+| sell_date | date || product | varchar |+-------------+---------+There is no primary key (column with unique values) for this table. It may contain duplicates.Each row of this table contains the product name and the date it was sold in a market. Write a solution to find for each date the number ..
SQL | LeetCode 176. 두 번째 최대값 구하기 (DENSE_RANK)
·
Computer Science/SQL
Table: Employee+-------------+------+| Column Name | Type |+-------------+------+| id | int || salary | int |+-------------+------+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 hi..
SQL | LeetCode 1667. 이름 포맷 통일하기 (CONCAT, UPPER, LOWER)
·
Computer Science/SQL
Table: Users+----------------+---------+| Column Name | Type |+----------------+---------+| user_id | int || name | varchar |+----------------+---------+user_id is the primary key (column with unique values) for this table.This table contains the ID and the name of the user. The name consists of only lowercase and uppercase characters. Write a solution to fix the names..
올리브한입
올리브코드랩