Basic Select 2
Revising Aggregations - The Count Function
๋ ์ ์๋ธ์ฟผ๋ฆฌ๊น์ง ์๊ฐํ๊ฑฐ์ง..? ์๋ฌดํผ ์ด๋ ต์ง ์์๋ฏ
Revising Aggregations - The Sum Function
๋์ด๋ ์์ค์ด....?
Revising Aggregations - Averages
ํํ ์ด์งํ๋ค์
Average Population
์์์ ์ผ๋ก ๋๋์ด์ง๋ ํ๊ท ์ ๋จ์ํ๊ฒ ์ ์๋ก ๋ฒ๋ฆผํ๋ ๋ฌธ์ - TRUNC์ด๋ผ๋ ํจ์๋ฅผ ์ด์ฉํ์
TRUNC ํจ์๋ ๋ ์ง๋ ์ซ์๋ฅผ ์๋ฅด๋๋ฐ ์ฌ์ฉํ๋ ํจ์์ด๋ค.
์ด๋ฒ์ ์ซ์์ ๊ฒฝ์ฐ์๋ TRUNC(์ซ์, ์๋ผ๋ฒ๋ฆด์๋ฆฌ์)
๊ทธ๋์ TRUNC(AVG(POPULATION), 3) ์ด๋ฐ ๊ฒฝ์ฐ์๋ 3๋ฒ์งธ ์๋ฆฌ์๊น์ง ์ญ์ ํ๊ฒ ๋ค๋ ์๋ฏธ์ด๋ค.
Japan Population
๊ทธ๋ฅ Sum ์ฌ์ฉํ๋ ๋จ์ํ ๋ฌธ์
Population Density Difference
population์ด ๊ฐ์ฅ ํฐ ๋์์ ๊ฐ - ๊ฐ์ฅ ์์ ๋์์ ๊ฐ
The Blunder
์.. ๋์ ์์ฑํด์ ๋ฃ๊ณ ์์๋๋ฐ, 0ํค๊ฐ ์๋จน๋๊ฑธ ๋ค ๊ธฐ์ ํ๊ณ ๋์ ๊นจ๋ณ์๋ค. ๊ทธ๋์ ์๋ณธ์ ํ๊ท - 0์ ๋บ ์ซ์๋ค์ ํ ๊ท ์ ๊ณ์ฐํ๊ณ ์ ์๋ก ๋ฐ์ฌ๋ฆผํด๋ผ
์ค์ฐ์ผ....
CEIL : ์ด์ ํ๋ TRUNC์ด ์๋ฅด๋ ์ญํ , ์ฆ ๋ฒ๋ฆผ์ด์๋ค๋ฉด ceil์ ์ ์๋ก ์ฌ๋ฆผํด์ฃผ๋ ํจ์์ธ๋ฐ ์ฌ๊ธฐ์ ์ค์ํ๊ฑด ์์์ ์ฒซ์งธ ์๋ฆฌ์์ ์ฌ๋ฆผํ๋ ํจ์๋ก ์ํ๋ ์๋ฆฌ์๋ฅผ ๋งค๊ธธ ์ ์๋ค๋ ๋จ์ ์ด ์๋ค
REPLACE : ํน์ ๋ฌธ์์ด์ ์นํํ๊ฑฐ๋ ์ ๊ฑฐํ๊ธฐ ์ํด์ ์ฌ์ฉ
REPLACE(์ปฌ๋ผ, ์ฐพ์๋ฌธ์, ๋ณํํ ๋ฌธ์)
Top Earners
์ง์
์๊ธ * ์์ ํ๋ฉด ํ์ฌ๊น์ง ๋ฐ์ ์๊ธํ์ ํ๊ณ ๊ฐ์ฅ ๋์ ์๊ธ์ ์ถ๋ ฅํ๊ณ ๊ทธ ์๊ธ์ ๋ฐ๋ ์ฌ๋์ ์๋ฅผ ์ถ๋ ฅ
์์นจ์ ์ถ๊ทผํด์ ๊ผญ ๋ณต์ตํ๊ธฐ!
Weather Observation Station 2
LAT_N์ ๋ค ๋ํ๊ณ , LONG_W์ ๋ค ๋ํ๊ณ ์์์ 2์งธ์ ๊น์ง ๋์ค๋๋ก ์ถ๋ ฅํ๋ผ
ROUND ํจ์๋ ์ ์์ ๋ฐ์ฌ๋ฆผ์ ํด์ฃผ๋ ํจ์์ด๊ณ ,
ROUND(์ํ๋ ๊ฐ, ๋ช์๋ฆฌ๊น์ง ๋จ์๊ฑด์ง)
์๋ฐ ์์ผ๋ก ์ฌ์ฉํ ์ ์๋ค
Weather Observation Station 13
38.7880<LAT_N<137.2345 ์ฌ์ด์ ์๋ ๊ฐ๋ค์ ํฉ ๊ตฌํ๊ณ 4์๋ฆฌ ์๋ก ์๋ผ๋ผ
Weather Observation Station 14
LAT_N ํญ๋ชฉ์์ 137.2345๋ณด๋ค ์์ ๊ฒ๋ค ์ค์์ ๊ฐ์ฅ ํฐ ์๋ฅผ 4์๋ฆฌ์๊น์ง ์๋ผ
Weather Observation Station 15
LATN์ด 137.2345๋ณด๋ค ์์ ๊ฒ๋ค ์ค์ ๊ฐ์ฅ ํฐ ์์ LONG_W๋ฅผ 4์๋ฆฌ๋ก ๋ฐ์ฌ๋ฆผํด์ ์ถ๋ ฅํ๋ผ
Weather Observation Station 16
Query the smallest Northern Latitude (LAT_N) from STATION that is greater than . Round your answer to decimal places.
Weather Observation Station 17
Query the Western Longitude (LONGW) where the smallest Northern Latitude(LAT_N) in STATION is greater than 38.7780. Round your answer to 4 decimal places.
Weather Observation Station 18
๋งจํดํ ๊ฑฐ๋ฆฌ - |a-c| + |b-d|๋ก ๊ตฌํ๊ณ ์์์ 4์๋ฆฌ๊น์ง๋ง ์ถ๋ ฅํ๋ผ
์ ๋๊ฐ์ ํํํด์ฃผ๋ ํจ์๋ ABS๋ฅผ ์ฌ์ฉํด์ ์ ๋๊ฐ์ ํํํ๋ค.
Weather Observation 19
Euclidean Distance = sqrt( (a-b)^2 +(c-d)^2 )๋ก ๊ตฌํ๊ณ ์์์ 4์ ๊น์ง๋ง ์ถ๋ ฅ
SQRT(ํ๋)๋ฅผ ํตํด์ ๋ฃจํธ๋ฅผ ๋งค๊ฒจ์ฃผ๋ ํจ์
POWER(ํ๋, ์ซ์)๋ฅผ ํตํด์ ํ๋๋ฅผ ์ซ์๋งํผ ์ง์ ์ฒ๋ฆฌํด์ฃผ๋ ํจ์
Weather Observation 20
LAT_N์ ์ค์๊ฐ์ ์์์ 4์๋ฆฌ ๊น์ง๋ง ์ถ๋ ฅ
์ค๋ผํด์์๋ ์ค์๊ฐ์ ์ฒ๋ฆฌํด์ฃผ๋ MEDIAN ํจ์๊ฐ ์กด์ฌ
Last updated
Was this helpful?