ETL Processing Mechanics of ETL.

Slides:



Advertisements
Similar presentations
Cs3431 Constraints Sections 6.1 – 6.5. cs3431 Example CREATE TABLE Student ( sNum int, sName varchar (20), prof int, CONSTRAINT pk PRIMARY KEY (snum),
Advertisements

SQL components In Oracle. SQL in Oracle SQL is made up of 4 components: –DDL Data Definition Language CREATE, ALTER, DROP, TRUNCATE. Creates / Alters.
Murali Mani SQL DDL and Oracle utilities. Murali Mani Datatypes in SQL INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME.
CSC 2720 Building Web Applications Database and SQL.
Using Relational Databases and SQL Steven Emory Department of Computer Science California State University, Los Angeles Lecture 10: Data Definition Language.
ETL and Metadata. The ETL Process Source Systems Extract Transform Staging Area Load Presentation System.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
HSCI 709 SQL Data Definition Language. SQL Standard SQL-92 was developed by the INCITS Technical Committee H2 on Databases. SQL-92 was designed to be.
CSC 2720 Building Web Applications Database and SQL.
Data Management Console Synonym Editor
SQL Basics. 5/27/2016Chapter 32 of 19 Naming SQL commands are NOT case sensitive SQL commands are NOT case sensitive But user identifier names ARE case.
SQL: DDL. SQL Statements DDL - data definition language –Defining and modifying data structures (metadata): database, tables, views, etc. DML - data manipulation.
Intro to SQL| MIS 2502  Spacing not relevant › BUT… no spaces in an attribute name or table name  Oracle commands keywords, table names, and attribute.
SQL Basics. What is SQL? SQL stands for Structured Query Language. SQL lets you access and manipulate databases.
Dec 8, 2003Murali Mani Constraints B term 2004: lecture 15.
1 DBS201: More on SQL Lecture 3. 2 Agenda How to use SQL to update table definitions How to update data in a table How to join tables together.
©Silberschatz, Korth and Sudarshan1 Structured Query Language (SQL) Data Definition Language Domains Integrity Constraints.
SY306 Web and Databases for Cyber Operations Databases - The Relational Model.
CREATE TABLE ARTIST ( ArtistID int NOT NULL IDENTITY (1,1), Namechar(25) NOT NULL, TEXT ERROR Nationality char (30) NULL, Birthdate numeric (4,0) NULL,
Lec-7. The IN Operator The IN operator allows you to specify multiple values in a WHERE clause. SQL IN Syntax SELECT column_name(s) FROM table_name WHERE.
Database Constraints Ashima Wadhwa. Database Constraints Database constraints are restrictions on the contents of the database or on database operations.
CCT395, Week 6 Implementing a Database with SQL and a Case Study Exercise This presentation is licensed under Creative Commons Attribution License, v.
Fundamentals of DBMS Notes-1.
Y.-H. Chen International College Ming-Chuan University Fall, 2004
CS SQL.
Indexes By Adrienne Watt.
SQL: Schema Definition and Constraints Chapter 6 week 6
Insert, Update and the rest…
Prepared by : Moshira M. Ali CS490 Coordinator Arab Open University
Referential Integrity MySQL
Session 4 PHP & MySQL.
Prepared for Prof. JAI NAVLAKHA By Hsin-Yu Ha
ITEC 313 Database Programming
Normalizing an Existing Table
MySQL Explain examples
Designing Tables for a Database System
Module 5: Implementing Data Integrity by Using Constraints
The Relational Model Relational Data Model
لغة قواعد البيانات STRUCTURED QUERY LANGUAGE SQL))
SQL OVERVIEW DEFINING A SCHEMA
SQL data definition using Oracle
COP4710 Database Management Connect to PostgreSQL sever via pgAdmin
Typically data is extracted from multiple sources
مقدمة في قواعد البيانات
Prepared for Prof. JAI NAVLAKHA By Hsin-Yu Ha
CS122 Using Relational Databases and SQL
CMPT 354: Database System I
This allows me to insert data for specified fields and not for other fields in the structure.
CS122 Using Relational Databases and SQL
Rob Gleasure robgleasure.com
Database Management System
COP4710 Database Management Connect to PostgreSQL sever via pgAdmin
CS1222 Using Relational Databases and SQL
Data Definition Language
Data Definition Language
Prepared for Prof. JAI NAVLAKHA By Hsin-Yu Ha
Chapter 4 Introduction to MySQL.
CS122 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
CS122 Using Relational Databases and SQL
Instructor: Samia arshad
CS122 Using Relational Databases and SQL
ETL Processing Mechanics of ETL.
CS122 Using Relational Databases and SQL
កម្មវិធីបង្រៀន SQL Programming ជាភាសាខ្មែរ Online SQL Training Course
SQL NOT NULL Constraint
SQL (Structured Query Language)
SQL AUTO INCREMENT Field
Data Base.
Presentation transcript:

ETL Processing Mechanics of ETL

The Flow Source File Extract Transform Transformed File Extract Generate Key Presentation Mart Surrogate Keys

The Flow Customer Extract Transform Transformed File CopyCustomer Generate Key Presentation Mart NewTable

Extract Customer data into a working table SELECT * INTO SalesCopy FROM Sales;

Add Surrogate Keys Create a table with primary key and surrogate key attributes, transaction primary key as primary key and autoincrement for a new surrogate key

Create a Surrogate Key Table create table surrogate ( keyval int constraint pk primary key, Autokey int identity(1,1), Surrogate int)

Insert primary keys into the surrogate key table and generate surrogate keys. INSERT INTO Surrogate (KeyVal) SELECT KeyVal FROM Sales WHERE KeyVal NOT IN (SELECT KeyVal FROM Surrogate);

Copy the autonumber field into an integer field. UPDATE Surrogate SET Surrogate= autokey WHERE surrogate is null

Add a CustomerKey column to the CustomerCopy table ALTER TABLE Sales ADD SalesKey Int;

Update the CustomerCopy table to add surrogate keys. UPDATE sales SET sales.saleskey = surrogate.surrogate FROM sales, surrogate WHERE sales.keyval = surrogate.keyval

Drop unnecessary columns ALTER TABLE CustomerCopy DROP balance;