Sunteți pe pagina 1din 4

EXERCISE WORKBOOK

[MI2143]-[2011-2012]#[K2.V1] Nama MK : DASAR SQL Disampaikan pada minggu ke-4 pertemuan 1 dan 2
Program Studi Manajemen Informatika Politeknik Telkom Bandung Jl. Telekomunikasi Terusan Buah Batu, Bandung, 40254

IDENTITAS Kajian Integritas Data Topik [Mengenal integritas data dan konsep gambaran data dan jenis-jenis integritas data] Referensi [1] Ramakrisnan Raghu. Database Management System. McgrawHill [2] Oracle Database Concepts 10g Release 2 (10.2). Part Number B14220-02. Oracle corp Kompetensi Utama Menguasai konsep integritas data Mampu menentukan jenis integritas data untuk setiap tabel Lama Pengerjaan 2 x 30 menit Jenis Pengerjaan *(bisa dipilih lebih dari 1) Individu Kelompok Mandiri Terbimbing 2 PERTANYAAN PENDAHULUAN
1. 2. 3. 4. Jelaskan definisi integritas data? Sebutkan jenis-jenis integritas data! Jelaskan mengenai Null Rule, Unique Column Values, Primary Key Values, Referential Integrity Rules! Jelaskan aturan-aturan yang terkait dengan referential integrity, seperti restrict, set to null, set to default, cascade dan no action!

Berisi daftar pertanyaan pendahuluan untuk bahan eksplorasi mahasiswa sebelum memulai perkuliahan.

RINGKASAN TEORI Ringkasan materi :


3.1 INTRODUCTION TO DATA INTEGRITY
It is important that data adhere to a predefined set of rules, as determined by the database administrator or application developer. As an example of data integrity, consider the tables employees and departments and the business rules for the information in each of the tables, as illustrated in Figure 21-1.

EXERCISE WORKBOOK
[MI2143]-[2011-2012]#[K2.V1] Nama MK : DASAR SQL Disampaikan pada minggu ke-4 pertemuan 1 dan 2
Program Studi Manajemen Informatika Politeknik Telkom Bandung Jl. Telekomunikasi Terusan Buah Batu, Bandung, 40254

Figure 21-1 Examples of Data Integrity

Description of "Figure 21-1 Examples of Data Integrity"

Note that some columns in each table have specific rules that constrain the data contained within them. 3.1.1 Types of Data Integrity This section describes the rules that can be applied to table columns to enforce different types of data integrity. 1. Null Rule A null rule is a rule defined on a single column that allows or disallows inserts or updates of rows containing a null (the absence of a value) in that column. 2. Unique Column Values A unique value rule defined on a column (or set of columns) allows the insert or update of a row only if it contains a unique value in that column (or set of columns). 3. Primary Key Values A primary key value rule defined on a key (a column or set of columns) specifies that each row in the table can be uniquely identified by the values in the key. 4. Referential Integrity Rules A referential integrity rule is a rule defined on a key (a column or set of columns) in one table that guarantees that the values in that key match the values in a key in a related table (the referenced value).

EXERCISE WORKBOOK
[MI2143]-[2011-2012]#[K2.V1] Nama MK : DASAR SQL Disampaikan pada minggu ke-4 pertemuan 1 dan 2
Program Studi Manajemen Informatika Politeknik Telkom Bandung Jl. Telekomunikasi Terusan Buah Batu, Bandung, 40254

Referential integrity also includes the rules that dictate what types of data manipulation are allowed on referenced values and how these actions affect dependent values. The rules associated with referential integrity are: a) Restrict: Disallows the update or deletion of referenced data. b) Set to Null: When referenced data is updated or deleted, all associated dependent data is set to NULL. c) Set to Default: When referenced data is updated or deleted, all associated dependent data is set to a default value. d) Cascade: When referenced data is updated, all associated dependent data is correspondingly updated. When a referenced row is deleted, all associated dependent rows are deleted. e) No Action: Disallows the update or deletion of referenced data. This differs from RESTRICT in that it is checked at the end of the statement, or at the end of the transaction if the constraint is deferred. (Oracle uses No Action as its default action.) 5. Complex Integrity Checking Complex integrity checking is a user-defined rule for a column (or set of columns) that allows or disallows inserts, updates, or deletes of a row based on the value it contains for the column (or set of columns).

STUDI KASUS

Dari studi kasus perpustakaan/sewa buku diketahui diagram relationship sebagai berikut:

EXERCISE WORKBOOK
[MI2143]-[2011-2012]#[K2.V1] Nama MK : DASAR SQL Disampaikan pada minggu ke-4 pertemuan 1 dan 2
Program Studi Manajemen Informatika Politeknik Telkom Bandung Jl. Telekomunikasi Terusan Buah Batu, Bandung, 40254

NonMember PK,FK1 IdPeminjam PK Peminjam idepeminjam Nama Kota Propinsi Kodepos Member PK,FK1 Idpeminjam Idmember No_Rekening

Telp_Peminjam PK,FK1 PK idepeminjam Telp

Peminjaman PK PK,FK1 Idpinjam Idpeminjam tglpinjam

Detail_Pinjaman PK,FK1 PK,FK2 PK Idpinjam Idbuku Iddetailpinjambuku Harga Tglwajibkembali

Pengembalian PK idepengembalian Tgl_kembali denda PK Detail_pengembalian PK,FK2 PK,FK2 idpengembalian Iddetailpinjambuku

Buku Idbuku Penerbit harga_pinjam namapengarang lamapinjam

4.1

BAGIAN A (INDIVIDU)

Setiap individu wajib membuat resume mengenai integritas data berdasarkan referensi di workbook ini dan boleh juga dari sumber lainnya. Hasil resume dipresentasikan di kelas dengan memilih mahasiswa secara acak.

4.2

BAGIAN B (KELOMPOK)

Berdasarkan studi kasus pada bagian 4: 1. 2. 3. 4. Tentukan semua jenis integritas data yang terdapat pada diagram relationship tersebut. Tentukan aturan referential integrity yang ada pada setiap tabel yang memiliki relasi dengan tabel lain. Dikerjakan berkelompok maksimal 3 orang. Presentasikan di kelas dan dibahas bersama.

PEMBAHASAN

S-ar putea să vă placă și