[SQL๋ฌธ์ œํ’€๊ธฐ - Advent of SQL 2025 ๐ŸŽ…] ํฌ๋ฆฌ์Šค๋งˆ์Šค๋ฅผ ๊ธฐ๋…ํ•  ์™„๋ฒฝํ•œ ์™€์ธ ์ฐพ๊ธฐ ๐Ÿฅ‚

silver's avatar
Dec 08, 2025
[SQL๋ฌธ์ œํ’€๊ธฐ - Advent of SQL 2025 ๐ŸŽ…] ํฌ๋ฆฌ์Šค๋งˆ์Šค๋ฅผ ๊ธฐ๋…ํ•  ์™„๋ฒฝํ•œ ์™€์ธ ์ฐพ๊ธฐ ๐Ÿฅ‚

๋ฌธ์ œ

๋‚ด๊ฐ€ ์ž‘์„ฑํ•œ ์ •๋‹ต

MySQL, SQLite, PostgreSQL

select * from wines where color = 'white' and quality >= 7 and density > (select avg(density) from wines) and residual_sugar > (select avg(residual_sugar) from wines) and pH < (select avg(pH) from wines where color = 'white') and citric_acid > (select avg(citric_acid) from wines where color = 'white')
 
Share article

silver