Zacznij terazZacznij za darmo

UDFs and UDTFs — Question 3

Use the database TASTY_BYTES. Create a user-defined table function called menu_prices_below using the CREATE FUNCTION command. Have it take in an argument called price_ceiling of type NUMBER. Have it return TABLE (item VARCHAR, price NUMBER), and make the contents of the function the following: SELECT&nbsp;MENU_ITEM_NAME,&nbsp;SALE_PRICE_USD &nbsp;&nbsp;&nbsp;&nbsp;FROM&nbsp;TASTY_BYTES.RAW_POS.MENU &nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;SALE_PRICE_USD&nbsp;<&nbsp;price_ceiling &nbsp;&nbsp;&nbsp;&nbsp;ORDER&nbsp;BY&nbsp;2&nbsp;DESC When you run SELECT * FROM TABLE(menu_prices_below(3)); what is the item you see repeated multiple times in Results?

To ćwiczenie jest częścią kursu

Intro to Snowflake for Devs, Data Scientists, Data Engineers

Zobacz kurs

Interaktywne ćwiczenie praktyczne

Przekształć teorię w praktykę dzięki jednemu z naszych interaktywnych ćwiczeń

Rozpocznij ćwiczenie