-
[SQL] 조건문을 활용한 모든 데이터 조회하기Data Analysis/SQL 2023. 12. 10. 23:14반응형
Table of Contents
- Question
- Answer
- Reference
Question
Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.
The CITY table is described as follows:
Answer
Question quest us how to query all columns for all America cities. And it tell us they have populations larger than 100000. So, We use "Condition Filtering".
SELECT * FROM CITY WHERE POPULATION > 100000 AND COUNTRYCODE = 'USA'
Reference
"Condition Filtering", MySQL, https://dev.mysql.com/doc/refman/8.0/en/condition-filtering.html
"Revising the Select Query", hackerrank, https://www.hackerrank.com/challenges/revising-the-select-query/
반응형'Data Analysis > SQL' 카테고리의 다른 글
[SQL] 짝수와 홀수인 조건으로 조회하기 (1) 2023.12.16 [SQL] 조건문을 활용한 특정 칼럼 조회하기 (1) 2023.12.15 [SQL] 날짜 함수를 이용하여 특정 기간 데이터 조회하기 (4) 2023.06.16 [SQL] Windows에서 MariaDB root 계정 분실 시 (2) 2023.04.05 [SQL] SQL(Structured Query Language)이란? (2) 2023.03.23