시작하기무료로 시작하기

Stored Procedures — Question 1

Let’s say you wanted to make it really easy to increase the prices across all items on the menu. We can make a stored procedure to do that! Use the tasty_bytes_clone database we created in the assignment on cloning (or if you didn’t do that, just run: CREATE DATABASE tasty_bytes_clone CLONE tasty_bytes;), and then use the CREATE PROCEDURE command to create a stored procedure with the following components: • Name it increase_prices • Have it return a Boolean (though this doesn’t matter here) • Set the language to be SQL • And then enter the following code as the content (the part between the BEGIN and END lines): UPDATE tasty_bytes_clone.raw_pos.menu   SET SALE_PRICE_USD = menu.SALE_PRICE_USD + 1; After you create this increase_prices stored procedure, call the stored procedure using the CALL command. After you run the CALL command, what column name do you see in the results, and what value do you see under that column name?

이 연습은 강의의 일부입니다

Intro to Snowflake for Devs, Data Scientists, Data Engineers

강의 보기

실습형 인터랙티브 연습문제

이론을 실습으로 바꾸는 인터랙티브 연습 중 하나를 만나보세요

연습 시작