Week 31 – Basic

Frosty Friday’s super academy wants to know who their best and worst super heroes are, and the only metric that matters is villains defeated. Using MIN_BY and MAX_BY, tell us which super hero is the best, and which is the worst.

create or replace table w31(id int, hero_name string, villains_defeated number);

insert into w31 values
  (1, 'Pigman', 5),
  (2, 'The OX', 10),
  (3, 'Zaranine', 4),
  (4, 'Frostus', 8),
  (5, 'Fridayus', 1),
  (6, 'SheFrost', 13),
  (7, 'Dezzin', 2.3),
  (8, 'Orn', 7),   
  (9, 'Killder', 6),   
  (10, 'PolarBeast', 11)
  ;

Your end result should look something like this:

Remember, if you want to participate:

  1. Sign up as a member of Frosty Friday. You can do this by clicking on the sidebar, and then going to ‘REGISTER
  2. Post your code to GitHub and make it publicly available (Check out our guide if you don’t know how to here)
  3. Post the URL in the comments of the challenge

8 responses to “Week 31 – Basic”

  1. ChrisHastie avatar
    ChrisHastie

    Thanks for using this platform to promote new functionality!

    • Solution URL – https://github.com/ChrisHastieIW/Frosty-Friday
  2. Jamie Laird avatar
    Jamie Laird

    Here’s my solution

    • Solution URL – https://github.com/apd-jlaird/frosty-friday/tree/main/week_31
  3. dsmdavid avatar
    dsmdavid

    Neat! Useful new functions

    • Solution URL – https://github.com/dsmdavid/frostyfridays-sf/blob/main/models/challenge_31.sql
  4. zlzlzl2 avatar
    zlzlzl2

    Pretty easy one this time.

    • Solution URL – https://github.com/zlzlzl2-data/FrostyFriday/blob/main/FF31_LZ.sql
  5. Atzmonky avatar
    Atzmonky

    Indeed, a very simple one.. but handy functions!

    • Solution URL – https://github.com/Atzmonky/snowflake/blob/main/ffch31_min_max.sql
  6. arjan.loogman avatar
    arjan.loogman

    Nice!

    • Solution URL – https://github.com/arjansnowflake/Frosty_Friday/blob/main/Week_31/week_31.sql
  7. Non-deterministicNorman avatar
    Non-deterministicNorman

    handy that

    • Solution URL – https://github.com/NMangera/frosty_friday/blob/main/week%2031%20-%20basic%20/MIN_BY%20%26%20MAX_BY

Leave a Reply