inblog logo
|
silver
    SQL๋ฌธ์ œํ’€๊ธฐ

    [SQL๋ฌธ์ œํ’€๊ธฐ - Advent of SQL 2025 ๐ŸŽ…] ์˜ฌ๋ฆผํ”ฝ ๋ฉ”๋‹ฌ์ด ์žˆ๋Š” ๋ฐฐ๊ตฌ ์„ ์ˆ˜

    silver's avatar
    silver
    Dec 10, 2025
    [SQL๋ฌธ์ œํ’€๊ธฐ - Advent of SQL 2025 ๐ŸŽ…] ์˜ฌ๋ฆผํ”ฝ ๋ฉ”๋‹ฌ์ด ์žˆ๋Š” ๋ฐฐ๊ตฌ ์„ ์ˆ˜
    Contents
    ๋ฌธ์ œ๋‚ด๊ฐ€ ์ž‘์„ฑํ•œ ์ •๋‹ต

    ๋ฌธ์ œ

    solvesql.com
    solvesql.com
    https://solvesql.com/problems/volleyball-players-with-medals/

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

    MySQL, SQLite

    select a.id, a.name, group_concat(r.medal) medals from records r join athletes a on a.id = r.athlete_id where r.team_id in (select id from teams where team = 'KOR') and r.event_id in (select id from events where event = 'Volleyball Women''s Volleyball') and r.medal is not null group by a.id;

    PostgreSQL

    select a.id, a.name, string_agg(r.medal,',') medals from records r join athletes a on a.id = r.athlete_id where r.team_id in (select id from teams where team = 'KOR') and r.event_id in (select id from events where event = 'Volleyball Women''s Volleyball') and r.medal is not null group by a.id;
     
    Share article

    silver

    RSSยทPowered by Inblog