Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

SQL Query for Data Archiving and Data Cleaning in a Data Warehouse, Thesis of Database Programming

An sql query example for archiving and cleaning data in a data warehouse. The query selects data from a table named [ww tier_1] with a fiscal quarter condition, groups it, and orders the results. It also includes commands for archiving old data into a new table, deleting the old data, and counting the number of records before and after the archiving process. The document also includes a query for selecting data from another table named dim_ba_product_ref.

Typology: Thesis

2016/2017

Uploaded on 07/26/2017

fahad-khan-1
fahad-khan-1 🇮🇳

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
select fiscal_quarter, count(*) as Count
from [WW TIER_1] with (nolock)
group by fiscal_quarter
order by fiscal_quarter
select count(*) from [WW TIER_1] where fiscal_quarter < 'FY15Q1' --1940933
Select * into [Archive_WW TIER_1_17072017]
from [WW TIER_1] where fiscal_quarter < 'FY15Q1'
select count(*) from [Archive_WW TIER_1_17072017]
delete from [WW TIER_1] where fiscal_quarter < 'FY15Q1'
select count(*) from [WW TIER_1] where fiscal_quarter >= 'FY15Q1' --2381934
select * from DIM_BA_PRODUCT_REF

Partial preview of the text

Download SQL Query for Data Archiving and Data Cleaning in a Data Warehouse and more Thesis Database Programming in PDF only on Docsity!

select fiscal_quarter, count() as Count from [WW TIER_1] with (nolock) group by fiscal_quarter order by fiscal_quarter select count() from [WW TIER_1] where fiscal_quarter < 'FY15Q1' -- Select * into [Archive_WW TIER_1_17072017] from [WW TIER_1] where fiscal_quarter < 'FY15Q1' select count() from [Archive_WW TIER_1_17072017] delete from [WW TIER_1] where fiscal_quarter < 'FY15Q1' select count() from [WW TIER_1] where fiscal_quarter >= 'FY15Q1' -- select * from DIM_BA_PRODUCT_REF