Surrogate Key & Slowly Changing Dimensions. SURROGATE KEY.

Slides:



Advertisements
Presentasi serupa
Sejarah (1) • Tahun 1974, Dr. Chamberlin dari Saan Jose Laboratorium IBM mendefinisikan sebuah bahasa untuk mengakses database yang disebut dengan SEQUEL.
Advertisements

Model Kubus Data Melihat data sebagai kubus.
Pertemuan 2 : Dasar-dasar SQL SBD C – Senin, Frank & Rudy
SISTEM BASIS DATA INTRO-5. •Setelah mengikuti perkuliahan ini diharapkan mahasiswa dapat mengerti : 1.Aplikasi perintah SQL ke MySql Server 2.Mengerti.
PERINTAH SQL.
Dasar-dasar SQL soesanto.
BEKERJA DENGAN COMMAND LINE
DDL(DATA DEFINITION LANGUAGE) DML (DATA MANIPULATION LANGUAGE)
Database Create-Retrieve-Update-Delete (CRUD)
PEMROGRAMAN BASIS DATA
SISTEM BASIS DATA Database Management System
EXERCISE DML Part I 1.Buatlah sebuah tabel baru nama = Dosen kolom = nik, nama,gelardpn,gelarblkg, jenkel,tgllahir,alamat,notelp. primary key  nik * type.
Latihan SQL.
Data Warehouse dan Decision Support
Oleh : Kholid Fathoni, S.Kom., M.T.
Database MySQL.
Manajemen Basis Data menggunakan SQL Server
Desain Data Warehouse (Dimensional Modelling)
Dimensional Modeling Achmad Yasid.
Dimensional Modeling Achmad Yasid.
CHANGE DATA CAPTURE.
MEMBUAT DATABASE MENGGUNAKAN MICROSOFT SQL SERVER 2008
PEMODELAN DATA.
STRUKTUR TABEL.
Sumber Data untuk DW Data operasional dalam organisasi, misalnya basis data pelanggan dan produk, dan Sumber eksternal yang diperoleh misalnya melalui.
SQL 2. Database TRANSACTION Tabel yang terlibat : Customer berisi data pelanggan (nama, alamat, dll) OderInfo berisi info pemesanan oleh pelanggan (tgl.
Pemrograman Web/MI/D3 sks
Dimensional Modeling (Advance)
TRIGGER.
1 Bab 3 Structured Query Language (SQL) Basis Data
Microsoft SQL Server DDL dan DML dasar
Review DDL Pertemuan ke 2.
PRAKTIKUM 3 PEMROGRAMAN BASIS DATA. Menghapus baris  Deleting rows- DELETE FROM Use the DELELE FROM command to delete row(s) from a table, with the following.
Tabled Value Parameter. Tabled Value Parameter merupakan tipe data yang dibuat oleh user Tabled Value Parameter digunakan untuk mengirimkan multiple rows.
Koneksi PHP ke Database MySQL
Modul : PHP dan MySQL Mempelajari koneksi PHP dengan database MySQL dan Fungsi-fungsi asesnya Modul-: PHP dan My SQL.
Perancangan Data Warehouse
Pertemuan VI Desain Data Warehouse (Dimensional Modelling)
Desain Data Warehouse (Dimensional Modelling)
STRUCTURED QUERY LANGUAGE (SQL)
Pertemuan VIII Dimensional Modelling. Relational Database Model FMMFFMMF Anderson Green Lee Ramos Attribute 1 Name Attribute 2 Age Attribute.
Dasar query basis data dengan SQLite
Presented by HANIM M.A. DATA WAREHOUSE (2nd) Presented by HANIM M.A.
Pengenalan Database MySQL
Modul SBD-2 …….. SQL Server
Pertemuan after UTS Structure Query Language (SQL)
FUNGSI-FUNGSI AKSES MySql
SQL.
Bahasa query terpan.
Manajemen Basis Data menggunakan SQL Server
Model Kubus Data Melihat data sebagai kubus.
Konsep Teknologi Informasi B
SQL pada basis data client-server
DESAIN BASIS DATA-Bagian 3
SQL OVERVIEW.
DESAIN BASIS DATA-Bagian 4
Query dalam sql server Pertemuan 6.
Structured Query Language
Perancangan Data Warehouse
Presented by HANIM M.A. DATA WAREHOUSE (2nd) Presented by HANIM M.A.
Aplikasi Database Dosen : Sarwo, Skom,.Mkom Url :
EXERCISE DML Part I Buatlah sebuah tabel baru nama = Dosen
Mulok Basis-Data OLEH Sidik Pramana, S.Kom
Basis Data Bab 3 Structured Query Language (SQL).
Introduction to Data Warehouse By: Marcello Singadji
KULIAH “PRAKTIKUM BASIS DATA“ TEKNIK INFORMATIKA UNIVERSITAS MERCU BUANA Oleh : AFIYATI S.KOM, MT.
Referensi Bahasa MySQL
Praktikum Sistem Basis Data - 2
Praktikum 2 - Sistem Basis Data 1
Skema Star (Dalam RDBMS)
Transcript presentasi:

Surrogate Key & Slowly Changing Dimensions

SURROGATE KEY

Solusi Surrogate Key

SQL Statement CREATE TABLE negara ( negara_sk int IDENTITY(1,2) PRIMARY KEY, kode_negara varchar(10) NOT NULL, nama_negara varchar(50) NOT NULL, gdp int) Identity(a,b) : – a : seed – b : increment

INSERT negara (kode_negara, nama_negara, gdp) VALUES (‘IND’, ‘Indonesia’, 100) INSERT negara (kode_negara, nama_negara, gdp) VALUES (‘SGP’, ‘Singapura’, 1000) INSERT negara (kode_negara, nama_negara, gdp) VALUES (‘KAN’, ‘Kanada’, 1100)

SELECT nama_negara, gdp FROM negara WHERE gdp > 100 SELECT negara.nama_negara, propinsi.nama_propinsi FROM negara, propinsi WHERE negara.kode_negara = ‘IND’ AND negara.negara_sk = propinsi.negara_sk

SLOWLY CHANGING DIMENSIONS

SCD Type 1 : Correction of Errors Contoh : – Perubahan nama customer Michel Romano menjadi Michael Romano – Perubahan nama customer setelah menikah (Kristin Daniels menjadi Kristin Samuelson)

SCD Type 2 : Preservation of History Contoh : perubahan status customer menjadi married dan perubahan alamat

SCD Type 3 : Tentative Soft Revisions Contoh : perubahan alamat customer

SNOWFLAKE SCHEMA

Snowflake schema : normalisasi tabel dimensi pada Star Schema Contoh : – Dimensi Product : products 500 product brands 10 product categories

AGGREGATE FACT TABLE

Ukuran Tabel Fakta

300 stores, 500 products per brand Fact table  penjualan product per store per week Query involves 1 product, 1 store, 1 week— retrieve/summarize only 1 fact table row Query involves 1 product, all stores, 1 week— retrieve/summarize 300 fact table rows Query involves 1 brand, 1 store, 1 week— retrieve/summarize 500 fact table rows Query involves 1 brand, all stores, 1 year— retrieve/summarize 7,800,000 fact table rows

Aggregates have fewer rows than the base tables Formation of aggregate fact tables is certainly a very effective method to improve query performance

One-Way Aggregates Product category by store by date Product department by store by date All products by store by date Territory by product by date Region by product by date All stores by product by date Month by store by product Quarter by store by product Year by store by product

Two-Way Aggregates Product category by territory by date Product category by region by date Product category by all stores by date Product category by month by store Product category by quarter by store Product category by year by store Product department by territory by date Product department by region by date Product department by all stores by date Product department by month by store Product department by quarter by store Product department by year by store All products by territory by date All products by region by date All products by all stores by date All products by month by store All products by quarter by store All products by year by store District by month by product District by quarter by product District by year by product Territory by month by product Territory by quarter by product Territory by year by product Region by month by product Region by quarter by product Region by year by product All stores by month by product All stores by quarter by product All stores by year by product

Three-Way Aggregates Product category by territory by month Product department by territory by month All products by territory by month Product category by region by month Product department by region by month All products by region by month Product category by all stores by month Product department by all stores by month Product category by territory by quarter Product department by territory by quarter All products by territory by quarter Product category by region by quarter Product department by region by quarter All products by region by quarter Product category by all stores by quarter Product department by all stores by quarter Product category by territory by year Product department by territory by year All products by territory by year Product category by region by year Product department by region by year All products by region by year Product category by all stores by year Product department by all stores by year All products by all stores by year