Bắt đầu ngayBắt đầu miễn phí

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?

Bài tập này là một phần của khóa học

Intro to Snowflake for Devs, Data Scientists, Data Engineers

Xem khóa học

Bài tập tương tác thực hành

Biến lý thuyết thành hành động với một trong các bài tập tương tác của chúng tôi

Bắt đầu bài tập