- ์ ๊ทํํ์์ด๋? : ๋ฌธ์์ด์์ ํจํด์ ์ฐพ์๋ด๋ ์ผ์ข
์ ๊ท์น -> ์ค์ ๋ก ์ ๊ทํํ์์ ๋ค ์๊ณ ์ฐ๋ ์ฌ๋์ ๊ฑฐ์ ์์.(๊ฒ์์ ํด์ ์ฐ๋ ๊ฒฝ์ฐ๊ฐ ๋๋ถ๋ถ) -> ์ ๊ทํํ์์ด ์ด๋ฐ๊ฑฐ๊ตฌ๋ ํ๋ ์ดํด์ ํํ ๋ฆฌ์ผ ์ฌ์ดํธ์์ ์กฐ๊ธ ์ฐ์ต์ ํด๋ณธ ํ์ ๊ทธ ๋ค์๋ถํฐ๋ ํ์ํ ๋๋ง๋ค ๊ฒ์์ ํด์ ์ฐพ์์ธ ์ ์๋ ์ ๋๋ก ํ์ตํ ๊ฒ. 1. ๋ฌธ์ Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates. where LAT_N is the northern latitude and LONG_W is the western longitude. -> STATION ํ
์ด..
1. ๋ฌธ์ We define an employee's total earnings to be their monthly salary x months worked, and the maximum total earnings to be the maximum total earnings for any employee in the Employee table. Write a query to find the maximum total earnings for all employees as well as the total number of employees who have maximum total earnings. Then print these values as 2 space-separated integers. The Emplo..
*FROM์ , WHERE์ ์์ ์ฌ์ฉํ๋ ์๋ธ์ฟผ๋ฆฌ : ๊ฐ์์ ํ
์ด๋ธ์ ํ๋ ๋ ๋ง๋ ๋ค๋ผ๊ณ ์๊ฐ Task : ๊ฐ ์ฃผ์ ํ๊ท ๋ฒ์ฃ๋ฐ์์ COUNT ๋งค์ผ ๋ฒ์ฃ๊ฐ ๋ช๋ฒ ๋ฐ์ํ๋์ง๋ฅผ ํ์
(์๋ธ์ฟผ๋ฆฌ) -> ์ปฌ๋ผ(week, date, incident_daily) ๊ฒฐ๊ณผ๋ฌผ : (2+1+3+1+1+1+2)/7 -> ๋ง์ฝ 2020-01-06์ ๋ฒ์ฃ๊ฐ ์ผ์ด๋์ง ์์์ nan๊ฐ์ผ๋๋ ์๋ธ์ฟผ๋ฆฌ๊ฐ 2020-01-06์ incident_daily๋ฅผ ๊ณ์ฐํ์ง ์๊ธฐ ๋๋ฌธ์ (2+3+1+1+1+2)/6์ผ๋ก ๊ณ์ฐ์ด ๋จ. ํ์ง๋ง ์ฐ๋ฆฌ๋ 2020-01-06์ incident_daily๋ฅผ 0๊ฑด์ผ๋ก ๋๊ณ ๊ณ์ฐํ๊ณ ์ถ์ ๊ฒ์ด๊ธฐ ๋๋ฌธ์ ์ฌ์ค์ ๊ณ์ฐ์ (2+0+3+1+1+1+2)/7๋ก ๊ณ์ฐ์ด ๋์ด์ผํ๋ค๋ ์ ์ ์ ์ํ ๊ฒ! -> ํ๊ท , ๋ ์งํจ์๋ฅผ ์ฌ์ฉํ ..
1. ๋ฌธ์ Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table. The STATION table is described as follows: where LAT_N is the northern latitude and LONG_W is the western longitude. For example, if there are three records in the table with CITY values 'New York', 'New York', 'Bengalaru', there are 2 different city names: 'New Y..
1. ๋ฌธ์ Query the difference between the maximum and minimum populations in CITY. 2. ๋ดํ์ด SELECT MAX(POPULATION) - MIN(POPULATION) FROM CITY 3. ๊ฒฐ๊ณผ
1. ๋ฌธ์ Query the average population for all cities in CITY, rounded down to the nearest integer. -> rounded down : ๋ฒ๋ฆผ 2. ๋ดํ์ด CEIL() : ์ฌ๋ฆผ ex) SELECT CEIL(5.5) => 6 FLOOR() : ๋ด๋ฆผ ex) SELECT FLOOR(5.5) => 5 ROUND() : ๋ฐ์ฌ๋ฆผ ex) ROUND(5.556901, 4) => 5.5569 SELECT FLOOR(AVG(POPULATION)) FROM CITY -> ๋ด๋ฆผ์ ์ํด FLOOR()ํจ์๋ก ๊ฐ์ธ์ค 3. ๊ฒฐ๊ณผ
1. ๋ฌธ์ Query a count of the number of cities in CITY having a Population larger than 100,000. (larger than=์ด๊ณผ) 2. ๋ดํ์ด SELECT COUNT(ID) FROM CITY WHERE POPULATION > 100000 3. ๊ฒฐ๊ณผ
1. ๋ฌธ์ Query the total population of all cities in CITY where District is California. 2. ๋ดํ์ด SELECT SUM(POPULATION) FROM CITY WHERE DISTRICT="California" 3. ๊ฒฐ๊ณผ