๐Ÿ’ซ ๋ฌธ์ œ


 

๐Ÿ’ซ CODE

SELECT CAR_TYPE, COUNT(*) AS CARS
FROM CAR_RENTAL_COMPANY_CAR 
WHERE OPTIONS LIKE '%ํ†ตํ’์‹œํŠธ%' OR OPTIONS LIKE '%์—ด์„ ์‹œํŠธ%' OR OPTIONS LIKE '%๊ฐ€์ฃฝ์‹œํŠธ%'
GROUP BY CAR_TYPE
ORDER BY CAR_TYPE;

 

๐Ÿ’ซ ํ’€์ด ์กฐ๊ฑด

1. 'ํ†ตํ’์‹œํŠธ', '์—ด์„ ์‹œํŠธ', '๊ฐ€์ฃฝ์‹œํŠธ' ์ค‘ ํ•˜๋‚˜ ์ด์ƒ์˜ ์˜ต์…˜์ด ํฌํ•จ๋œ ์ž๋™์ฐจ
2. ์ž๋™์ฐจ ์ข…๋ฅ˜ ๋ณ„๋กœ ๋ช‡ ๋Œ€์ธ์ง€ ์ถœ๋ ฅ
3. ์ž๋™์ฐจ ์ˆ˜์— ๋Œ€ํ•œ ์ปฌ๋Ÿผ๋ช…์€ CARS๋กœ ์ง€์ •
4. ์ž๋™์ฐจ ์ข…๋ฅ˜ ๊ธฐ์ค€ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌ

 

๐Ÿ’ซ ํ’€์ด

1. SELECT CAR_TYPE, COUNT(*) AS CARS
  • ์ž๋™์ฐจ ์ข…๋ฅ˜ ๋ณ„๋กœ ๋ช‡ ๋Œ€์ธ์ง€ ์ถœ๋ ฅ
2. WHERE OPTIONS LIKE '%ํ†ตํ’์‹œํŠธ%' OR OPTIONS LIKE '%์—ด์„ ์‹œํŠธ%' OR OPTIONS LIKE '%๊ฐ€์ฃฝ์‹œํŠธ%'
  • 'ํ†ตํ’์‹œํŠธ', '์—ด์„ ์‹œํŠธ', '๊ฐ€์ฃฝ์‹œํŠธ' ์ค‘ ํ•˜๋‚˜ ์ด์ƒ์˜ ์˜ต์…˜์ด ํฌํ•จ๋œ ์ž๋™์ฐจ
3. GROUP BY CAR_TYPE
  • COUNTํ• ๋•Œ CAR_TYPE๋ฅผ ๊ธฐ์ค€์œผ๋กœ COUNT
4. ORDER BY CAR_TYPE
  • ์ž๋™์ฐจ ์ข…๋ฅ˜ ๊ธฐ์ค€ ์˜ค๋ฆ„์ฐจ์ˆœ ์ •๋ ฌ

By Dozzing

๋‹ต๊ธ€ ๋‚จ๊ธฐ๊ธฐ

์ด๋ฉ”์ผ ์ฃผ์†Œ๋Š” ๊ณต๊ฐœ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ํ•„์ˆ˜ ํ•„๋“œ๋Š” *๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค