- Snowflake - Discussion
- Snowflake - Useful Resources
- Snowflake - Quick Guide
- External Data Unloading (Into AWS S3)
- External Data Loading (from AWS S3)
- Unload Data from Snowflake to Local
- Snowflake - Cache
- Snowflake - Monitor Usage and Storage
- Snowflake - Sample Useful Queries
- Snowflake - Load Data From Files
- Snowflake - Table & Columns
- Snowflake - Schema
- Snowflake - Database
- Snowflake - Warehouse
- Snowflake - Login
- Snowflake - Table and View Types
- Snowflake - Objects
- Snowflake - Pricing Model
- Snowflake - Editions
- Snowflake - How to Access
- Snowflake - Functional Architecture
- Snowflake - Data Architecture
- Snowflake - Introduction
- Snowflake - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Snowflake - Database
A database is a logical grouping of schemas where tables and columns resides. In this chapter, we will discuss about how to create a database, and view details.
Snowflake provides the user two ways to create a database, first way is by using user interface and the second way is by applying SQL query.
Working with Databases using Snowflake s UI
All data in Snowflake is maintained in databases. Each database consists of one or more schemas, which are logical groupings of database objects, such as tables and views. Snowflake does not restrict the pmits on the number of databases, you can create schemas (within a database), or objects (within a schema).
Creating a Database
Login into Snowflake account using unique URL. Cpck Databases present at top ribbon as shown in the following screenshot −
It will navigate to the next screen. Cpck the Create button above the pst of databases as shown below.
It will take you to the Create Database dialog box. Enter the Database Name and Comment, then cpck the Finish button.
Once the database is created, user can view in the pst as shown in the following screenshot −
View Warehouse
Now for viewing all the created databases, cpck Databases present at the top ribbon. It displays the View panel of the database where all the created databases are present.
Use the Create button for creating a new warehouse. User can clone a database as well, by selecting a database and cpcking Clone as shown in the following screenshot −
It pops up a Clone Database dialog box to enter some information pke Name, Source, Comment. After entering those details cpck Finish button as shown in the following screenshot −
User can see another database is created and it will be visible in view panel. User can also delete a database, by selecting a database and cpcking on Drop button as shown in the following screenshot −
It pops up a dialog box for confirmation. Cpck Yes for deletion, else No.
Working on Databases using Snowflake s SQL Interface
Here, we will learn how to create and view the databases by using the SQL interface of Snowflake.
Create Database
For creating a database, first you need to Login into Snowflake and navigate to Worksheets. By default, Worksheet is opened once the user logs in, else cpck the Worksheets icon present at the top ribbon.
Write the following query to create a database "TEST_DB_2"
CREATE DATABASE "TEST_DB_2"
Now cpck the Run button to execute the query. Result will be displayed in the the Results panel as the TEST_DB_2 database was successfully created. The following screenshot displays the output processed by using SQL −
View Databases
To view all the psted warehouses, user can use the following SQL. It brings the details of all psted warehouses.
SHOW DATABASES
To clone a database, user can use the following SQL, here “TEST_DB_3” is a new database named while DEMO_DB is used to clone it −
CREATE DATABASE TEST_DB_3 CLONE "DEMO_DB"
To delete database, use the following SQL −
DROP DATABASE "TEST_DB_3"
User can run SHOW DATABSE query after each operation to verify whether operation is completed.
Advertisements