How to Use Data Marketplace in Snowflake: Simple Steps
To use the
Data Marketplace in Snowflake, first browse or search for datasets in the marketplace UI, then create a database from a chosen dataset using CREATE DATABASE with the FROM SHARE clause. After that, query the shared data directly with SQL without copying it.Syntax
The main command to use data from Snowflake Data Marketplace is CREATE DATABASE <db_name> FROM SHARE <provider>.<share_name>. This creates a local database linked to the shared data.
CREATE DATABASE <db_name>: Makes a new database in your account.FROM SHARE <provider>.<share_name>: Specifies the data provider and the shared dataset to use.
Once created, you can query the data using normal SQL commands on the new database.
sql
CREATE DATABASE my_shared_data FROM SHARE data_provider.public_share
Example
This example shows how to create a database from a shared dataset and query it.
sql
CREATE DATABASE weather_data FROM SHARE weather_company.weather_share; USE DATABASE weather_data; SELECT * FROM daily_forecast LIMIT 5;
Output
+------------+------------+----------+
| date | location | temp_c |
+------------+------------+----------+
| 2024-06-01 | New York | 22 |
| 2024-06-01 | San Diego | 25 |
| 2024-06-01 | Chicago | 18 |
| 2024-06-01 | Miami | 30 |
| 2024-06-01 | Seattle | 20 |
+------------+------------+----------+
Common Pitfalls
- Trying to query shared data without creating a database from the share first will cause errors.
- Using incorrect provider or share names in the
FROM SHAREclause leads to failures. - Not having proper access or permissions to the shared data will block usage.
- Assuming data is copied locally; shared data is accessed live and read-only.
sql
/* Wrong: Querying without creating database */ SELECT * FROM weather_company.weather_share.daily_forecast LIMIT 5; /* Right: Create database first, then query */ CREATE DATABASE weather_data FROM SHARE weather_company.weather_share; USE DATABASE weather_data; SELECT * FROM daily_forecast LIMIT 5;
Quick Reference
Remember these key points when using Snowflake Data Marketplace:
- Use
CREATE DATABASE ... FROM SHAREto access shared data. - Shared data is live and read-only; no data copying needed.
- Check permissions and provider/share names carefully.
- Query shared data like any local table after database creation.
Key Takeaways
Create a database from a share using CREATE DATABASE ... FROM SHARE to access marketplace data.
Shared data is live and read-only; no need to copy or move data.
Always verify provider and share names to avoid errors.
You must have permissions to use shared data from the marketplace.
Query shared data using normal SQL after database creation.
