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 MENU_ITEM_NAME, SALE_PRICE_USD FROM TASTY_BYTES.RAW_POS.MENU WHERE SALE_PRICE_USD < price_ceiling ORDER BY 2 DESC When you run SELECT * FROM TABLE(menu_prices_below(3)); what is the item you see repeated multiple times in Results?
Diese Übung ist Teil des Kurses
<Kurs>Intro to Snowflake for Devs, Data Scientists, Data Engineers</Kurs>Interaktive praktische Übung
Verwandle Theorie mit einer unserer interaktiven Übungen in die Praxis
Übung starten