Create two testing tables in Snowflake

Database, Schema, Tables

In Snowflake, these will be created for testing Immuta-Snowflake integration

Database: immuta_pov_lite

Schema: pov_data_lite

Tables:

  • immuta_fake_credit_card_transactions

  • immuta_fake_hr_data

--you can use any database name, or create the tablesin an existing database/schema
drop database if exists immuta_pov_lite;
create database immuta_pov_lite;
drop schema if exists immuta_pov.pov_data_lite;
create schema immuta_pov.pov_data_lite;

use immuta_pov_lite.pov_data_lite; 
drop table if exists immuta_fake_credit_card_transactions;
drop table if exists immuta_fake_hr_data;

create table immuta_fake_credit_card_transactions (
	id INT,
	customer_last_name VARCHAR(50),
	credit_card_number VARCHAR(50),
	transaction_location VARCHAR(50),
	transaction_time TIMESTAMP,
	transaction_amount FLOAT,
	transaction_country VARCHAR(50)
);

create table immuta_fake_hr_data (
	id INT,
	first_name VARCHAR(50),
	last_name VARCHAR(50),
	email VARCHAR(50),
	gender VARCHAR(50),
	race VARCHAR(50),
	ssn VARCHAR(50),
	dept VARCHAR(50),
	job VARCHAR(50),
	skills VARCHAR(50),
	salary INT,
	type VARCHAR(20)
);

--populate the table with 10 rows of data values
INSERT INTO immuta_fake_credit_card_transactions VALUES
(1, 'Mattschas', 5400677127258333, 'Danxi', '2021-05-04 14:15:50', 145.0, 'CN'),
(2, 'Colborn', 6011509057428025, 'Úštěk', '2020-07-06 20:20:50', 447.62, 'CZ'),
(3, 'Dightham', 4485038383302, 'Tarusa', '2020-07-13 10:42:03', 15.4, 'RU'),
(4, 'Kraft', 6011295666859319, 'Zambujal', '2020-07-10 19:48:21', 6.42, 'PT'),
(5, 'Dabernott', 869923081335591, 'Karlskoga', '2020-12-25 18:11:36', 311.43, 'SE'),
(6, 'Lente', 201451897693372, 'Ulme', '2020-10-17 20:52:52', 86.82, 'PT'),
(7, 'Mattke', 4929214208395, 'Stryków', '2021-05-18 03:13:29', 779.54, 'PL'),
(8, 'Kenderdine', 210031523324201, 'Arcos', '2021-02-22 10:04:26', 163.5, 'PT'),
(9, 'Chattaway', 4476858781171622, 'Kuantan', '2021-05-17 09:38:16', 793.97, 'MY'),
(10, 'Grishanov', 5562847868942858, 'Auki', '2020-06-18 19:59:50', 563.7, 'SB');

INSERT INTO immuta_fake_hr_data VALUES
(1, 'Leanna', 'Leckenby', 'lleckenby0@cornell.edu', 'Female', 'Chickasaw', '327-25-5320', 'Services', 'Nuclear Power Engineer', 'CMMS', 245344, 'Part Time'),
(2, 'Madelyn', 'Schuck', 'mschuck1@oakley.com', 'Female', 'Hmong', '209-70-5539', 'Sales', 'Accountant II', 'RCSA', 109974, 'Intern'),
(3, 'Kirbie', 'Jenkison', 'kjenkison2@360.cn', 'Female', 'Fijian', '655-14-8209', 'Accounting', 'VP Product Management', 'Target Identification', 145949, 'Contractor'),
(4, 'Rustie', 'Markus', 'rmarkus3@tinyurl.com', 'Female', 'South American', '217-50-0739', 'Marketing', 'Human Resources Assistant III', 'Middle Office', 112386, 'Intern'),
(5, 'Robby', 'Challenor', 'rchallenor4@jimdo.com', 'Male', 'Sioux', '275-01-0955', 'Services', 'Analog Circuit Design manager', 'Graphic Illustrations', 93216, 'Intern'),
(6, 'Torrence', 'Battman', 'tbattman5@wordpress.com', 'Male', 'Paiute', '524-99-1674', 'Sales', 'Social Worker', 'Reaction Kinetics', 234872, 'Part Time'),
(7, 'Cliff', 'Giorgetti', 'cgiorgetti6@github.com', 'Male', 'Puerto Rican', '362-64-8984', 'Sales', 'Chief Design Engineer', 'Creative Writing', 242308, 'Full Time'),
(8, 'Daven', 'Lumsdall', 'dlumsdall7@wix.com', 'Female', 'Sri Lankan', '382-26-5392', 'Training', 'Software Test Engineer III', 'Press Releases', 164919, 'Contractor'),
(9, 'Kellina', 'Minchindon', 'kminchindon8@yale.edu', 'Male', 'Ecuadorian', '647-46-8985', 'Training', 'Geologist II', 'Lotus Domino', 186372, 'Part Time'),
(10, 'Alberto', 'Efford', 'aefford9@boston.com', 'Male', 'Spaniard', '194-01-1880', 'Services', 'Health Coach II', 'PVSyst', 209121, 'Intern');

GRANT access to PUBLIC or role of chose for testing purpose:

use role accountadmin;
use warehouse DEMO_WH;
use database immuta_pov_lite;
use schema pov_data_lite;

-- both USAGE and SELECT grants
GRANT USAGE ON DATABASE immuta_pov_lite TO ROLE PUBLIC;
GRANT USAGE ON SCHEMA immuta_pov_lite.pov_data_lite TO ROLE PUBLIC;
GRANT SELECT ON TABLE immuta_pov_lite.pov_data_lite.immuta_fake_credit_card_transactions TO ROLE PUBLIC;
GRANT SELECT ON TABLE immuta_pov_lite.pov_data_lite.immuta_fake_hr_data TO ROLE PUBLIC;

Last updated