본문 바로가기

SQL/[HackerRank]

[HackerRank/MySQL] Japanese Cities' Names

728x90

< Problem >

CITY 테이블에서 CountryCode가 JPN인 칼럼의 NAME 가져오기

링크:  https://www.hackerrank.com/challenges/japanese-cities-name/problem

 

Japanese Cities' Names | HackerRank

In this challenge, you will query a list of all the Japanese cities' names.

www.hackerrank.com


< Code >

SELECT name
FROM city
WHERE countrycode = 'JPN'

 

< Lesson & Learned >

SELECT 문 (조건검색)

SELECT: 키워드와 함께 검색하고 싶은 속성의 이름을 나열

FROM: 키워드와 함께 검색하고 싶은 속성이 있는 데이블의 이름을 나열

WHERE: 키워드와 함께 비교 연산자(=, <, >=, <>)와 논리 연산자(AND, OR, NOT)를 이용한 검색 조건 제시

728x90