Complete the code to create a Snowflake database named 'sales_db'.
CREATE DATABASE [1];The command CREATE DATABASE sales_db; creates a new database named 'sales_db' in Snowflake.
Complete the code to create a Snowflake warehouse named 'compute_wh'.
CREATE WAREHOUSE [1] WITH WAREHOUSE_SIZE = 'SMALL';
The command CREATE WAREHOUSE compute_wh WITH WAREHOUSE_SIZE = 'SMALL'; creates a compute warehouse named 'compute_wh' with a small size.
Fix the error in the code to select all data from the table 'customers' in the 'sales_db' database.
SELECT * FROM [1].customers;The correct syntax to select from a table in a specific database is database_name.schema_name.table_name. Here, sales_db.customers is incomplete because it misses the schema name. The correct fully qualified name should include the schema, for example, sales_db.public.customers.
Fill both blanks to grant the role 'analyst' the ability to read data from the 'sales_db' database.
GRANT [1] ON DATABASE sales_db TO ROLE [2];
The USAGE privilege is required to access objects (like schemas and tables) within the database. Granting it to the role 'analyst' is a key step to enable reading data from the database.
Fill all three blanks to create a table named 'orders' with columns 'id' (integer) and 'amount' (float) in the 'sales_db' database and 'public' schema.
CREATE TABLE [1].[2].orders (id [3], amount FLOAT);
The syntax CREATE TABLE database.schema.table is used. 'id' column type is 'INT' for integer.