Algorithm/MySQL (75) 썸네일형 리스트형 [LeetCode] 620. Not Boring Movies (MySQL) 문제 cinema 테이블의 id가 홀수이고, description이 지루하지 않은 값만 출력 순서는 rating이 내림차순으로, 그러니까 점수가 가장 높은 순으로 출력 코드 SELECT * FROM Cinema WHERE id % 2 = 1 -- 홀수 아이디만 출력 -- wHERE MOD(id, 2) = 1 -- 홀수 아이디 AND description "boring" -- 지루하지 않은 description만 출력 ORDER BY rating DESC -- 점수가 가장 높은 순으로 출력 홀수 아이디만 출력하는 조건은 id에서 2를 나눴을 때 나머지가 1일 경우 홀수이기 때문에 where절에 해당 조건 추가 지루하지 않은 description만 출력하기 위한 조건 추가 점수가 가장 높은 순으로 출력하기 .. [LeetCode] 595. Big Countries (MySQL) 문제 코드 Select name, population, area From World Where area > 3000000 OR population > 25000000 면적이 300만 km 초과이거나 인구가 2500백만 (25*100만) 초과인 나라 구하기 Name, population, area 출력 출처 [해커랭크(HackerRank)] Average Population (MySQL) 문제 Query the average population for all cities in CITY, rounded down to the nearest integer. Input Format The CITY table is described as follows: 코드 Select ROUND(AVG(population)) From City City 테이블에서 모든 도시의 평균 반올림 (정수와 가장 가까운 수) 출처 [해커랭크(HackerRank)] Revising Aggregations - Averages (MySQL) 문제 Query the average population of all cities in CITY where District is California. Input Format The CITY table is described as follows: 코드 Select AVG(population) From City Where district = 'California' City 테이블에서 California의 인구 평균 구하기 출처 이전 1 ··· 5 6 7 8 9 10 11 ··· 19 다음