📖 Scenario: You are working as a cloud data engineer. Your company wants to create a simple data marketplace listing using Snowflake. This marketplace will show available datasets with their names and descriptions.Think of it like a small online store, but instead of products, you list datasets that others can use.
🎯 Goal: Build a Snowflake table to hold marketplace listings with dataset names and descriptions. Then, create a view to show only active listings.
📋 What You'll Learn
Create a table named marketplace_listings with columns dataset_name (string), description (string), and is_active (boolean).
Insert exactly three listings with given dataset names, descriptions, and active status.
Create a variable active_status set to true to filter active listings.
Create a view named active_marketplace_listings that selects only listings where is_active matches active_status.
💡 Why This Matters
🌍 Real World
Data marketplaces help organizations share and discover datasets easily in cloud platforms like Snowflake.
💼 Career
Cloud data engineers and architects often build and manage data catalogs and marketplaces to enable data sharing and governance.
Progress0 / 4 steps
1
Create the marketplace listings table
Create a table called marketplace_listings with columns dataset_name as VARCHAR, description as VARCHAR, and is_active as BOOLEAN.
Snowflake
Hint
Use CREATE OR REPLACE TABLE with the exact column names and types.
2
Insert dataset listings
Insert three rows into marketplace_listings with these exact values: 1. 'CustomerData', 'Contains customer info', true 2. 'SalesData', 'Monthly sales records', false 3. 'ProductCatalog', 'Product details and prices', true
Snowflake
Hint
Use a single INSERT INTO statement with three value tuples.
3
Create a variable for active status
Create a variable called active_status and set it to true to represent active listings.
Snowflake
Hint
Use SET active_status = true; to create the variable.
4
Create a view for active listings
Create a view named active_marketplace_listings that selects dataset_name and description from marketplace_listings where is_active equals the variable active_status.
Snowflake
Hint
Use CREATE OR REPLACE VIEW and filter with WHERE is_active = $active_status.
Practice
(1/5)
1. What is the primary purpose of a data marketplace in Snowflake?
easy
A. To group data listings for easy sharing and discovery
B. To store raw data files permanently
C. To run complex SQL queries faster
D. To manage user access permissions
Solution
Step 1: Understand the role of a data marketplace
A data marketplace is designed to organize and share data listings so users can find and use data easily.
Step 2: Compare options with this purpose
Options A, B, and D describe other Snowflake features but not the marketplace's main role.
Final Answer:
To group data listings for easy sharing and discovery -> Option A
Quick Check:
Marketplace = Group data listings [OK]
Hint: Marketplaces group data listings for sharing [OK]
Common Mistakes:
Confusing marketplace with data storage
Thinking marketplace speeds up queries
Mixing marketplace with access control
2. Which SQL command correctly and safely creates a new data marketplace named my_marketplace in Snowflake?
easy
A. CREATE NEW MARKETPLACE my_marketplace;
B. CREATE DATA MARKETPLACE my_marketplace;
C. CREATE MARKETPLACE my_marketplace;
D. CREATE MARKETPLACE IF NOT EXISTS my_marketplace;
Solution
Step 1: Recall correct syntax for creating marketplace
Snowflake uses CREATE MARKETPLACE [IF NOT EXISTS] name; to create marketplaces safely.
Step 2: Check each option
CREATE MARKETPLACE my_marketplace; lacks IF NOT EXISTS and will fail if the marketplace already exists; Options B and D use invalid syntax; CREATE MARKETPLACE IF NOT EXISTS my_marketplace; is correct and safe.
Final Answer:
CREATE MARKETPLACE IF NOT EXISTS my_marketplace; -> Option D
Quick Check:
CREATE MARKETPLACE IF NOT EXISTS = safe creation [OK]
Hint: Use IF NOT EXISTS to avoid errors creating marketplace [OK]
Common Mistakes:
Adding extra keywords like DATA or NEW
Omitting IF NOT EXISTS causing errors if exists
Using incorrect command structure
3. Given the SQL query:
SHOW LISTINGS IN MARKETPLACE my_marketplace;
What will this command do?
medium
A. Create a new listing inside my_marketplace
B. Delete all listings from my_marketplace
C. Display all data listings available in the marketplace named my_marketplace
D. Show all marketplaces in the account
Solution
Step 1: Understand the SHOW LISTINGS command
This command lists all data listings inside a specified marketplace.
Step 2: Match command with options
Display all data listings available in the marketplace named my_marketplace matches the command's purpose; Options A and C describe create/delete actions which SHOW does not do; Show all marketplaces in the account shows all marketplaces in the account, not listings.
Final Answer:
Display all data listings available in the marketplace named my_marketplace -> Option C
Quick Check:
SHOW LISTINGS = list data sets [OK]
Hint: SHOW LISTINGS lists data sets in a marketplace [OK]
Common Mistakes:
Confusing SHOW with CREATE or DELETE
Thinking it lists marketplaces instead of listings
Assuming it modifies data
4. You run the command:
CREATE LISTING my_listing IN MARKETPLACE my_marketplace;
But get an error saying the marketplace does not exist. What is the most likely cause?
medium
A. The marketplace my_marketplace was not created before creating the listing
B. The listing name my_listing is invalid
C. You need to use DROP MARKETPLACE before CREATE LISTING
D. Listings cannot be created inside marketplaces
Solution
Step 1: Analyze the error message
The error says the marketplace does not exist, so the system cannot find my_marketplace.
Step 2: Check command dependencies
You must create the marketplace before adding listings inside it. If missing, this error occurs.
Final Answer:
The marketplace my_marketplace was not created before creating the listing -> Option A
Quick Check:
Create marketplace first, then listing [OK]
Hint: Create marketplace before listings to avoid errors [OK]
Common Mistakes:
Assuming listing name causes error
Trying to drop marketplace before listing
Believing listings can't be inside marketplaces
5. You want to share a dataset with external users by creating a listing in a marketplace. Which sequence of commands correctly achieves this?
hard
A. CREATE LISTING my_listing; CREATE MARKETPLACE my_marketplace; GRANT USAGE ON MARKETPLACE my_marketplace TO ROLE external_role;
B. CREATE MARKETPLACE my_marketplace; CREATE LISTING my_listing IN MARKETPLACE my_marketplace; GRANT USAGE ON LISTING my_listing TO ROLE external_role;
C. CREATE MARKETPLACE my_marketplace; GRANT USAGE ON MARKETPLACE my_marketplace TO ROLE external_role; CREATE LISTING my_listing IN MARKETPLACE my_marketplace;
D. GRANT USAGE ON LISTING my_listing TO ROLE external_role; CREATE MARKETPLACE my_marketplace; CREATE LISTING my_listing IN MARKETPLACE my_marketplace;
Solution
Step 1: Create the marketplace first
You must create the marketplace before adding listings inside it.
Step 2: Create the listing inside the marketplace
After marketplace creation, create the listing specifying the marketplace.
Step 3: Grant usage on the listing to external users
Granting usage on the listing allows external roles to access the shared data.
Final Answer:
CREATE MARKETPLACE my_marketplace; CREATE LISTING my_listing IN MARKETPLACE my_marketplace; GRANT USAGE ON LISTING my_listing TO ROLE external_role; -> Option B
Quick Check:
Create marketplace -> listing -> grant usage [OK]
Hint: Create marketplace, then listing, then grant access [OK]
Common Mistakes:
Creating listing before marketplace
Granting usage before creating listing
Granting usage on marketplace instead of listing
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.