I have an existing table and I dropped that table and I created new table with same table name as old
and with different data.
Is there any way to get the old table data in Snowflake?
This is a very interesting interview question for Snowflake profile , in this video I have explained about topic in-depth.
Please check this link to explore more about undrop command:
https://www.snowflake.com/blog/undrop....
Code:
--------
select * from "RAMU"."PUBLIC"."EMPLOYEE";
DROP DATABASE IF EXISTS RAMU;
select * from "RAMU"."PUBLIC"."EMPLOYEE";
UNDROP DATABASE RAMU;
select * from "RAMU"."PUBLIC"."EMPLOYEE";
DROP SCHEMA "RAMU"."PUBLIC";
select * from "RAMU"."PUBLIC"."EMPLOYEE";
UNDROP SCHEMA "RAMU"."PUBLIC";
select * from "RAMU"."PUBLIC"."EMPLOYEE";
DROP TABLE "RAMU"."PUBLIC"."EMPLOYEE";
UNDROP TABLE "RAMU"."PUBLIC"."EMPLOYEE";
DROP DATABASE RAMU;
CREATE DATABASE IF NOT EXISTS RAMU;
USE RAMU;
create or replace table Employee
( id int,
name varchar(200),
salary int,
departmentId int);
insert into Employee
values
(1, 'Joe', 85000, 1),
(2, 'Henry', 80000, 2),
(3, 'Sam', 60000, 2),
(4, 'Max', 90000, 1),
(5, 'Janet', 69000, 1),
(6, 'Randy', 85000, 1),
(7, 'Will', 70000, 1);
select * from Employee;
create or replace table Employee
( id int,
name varchar(200),
salary int,
departmentId int);
select * from Employee;
insert into Employee
values
(8, 'Hola', 85000, 1),
(9, 'Bhola', 80000, 2);
select * from Employee;
UNDROP TABLE Employee;
ALTER TABLE Employee RENAME TO Employee1;
SELECT * FROM Employee;
SELECT * FROM Employee1;
UNDROP TABLE Employee;
SELECT * FROM Employee;
Check this playlist for more AWS Projects in Big Data domain:
• Demystifying Data Engineering with Cloud C...
Информация по комментариям в разработке