30
1 Chapter 2 Chapter 2 Database Environment Database Environment Transparencies Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011 http://arief.ismy.web.id

1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

Embed Size (px)

Citation preview

Page 1: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

11

Chapter 2Chapter 2

Database EnvironmentDatabase Environment

TransparenciesTransparenciesLast Updated: Pebruari 2010

By M. AriefUpdated by RSO Feb 2011

http://arief.ismy.web.id

Page 2: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

2

Chapter 2 - ObjectivesChapter 2 - Objectives► Database architecture.Database architecture.

► Database languagesDatabase languages

► Data ModelData Model

► Database functionsDatabase functions

http://arief.ismy.web.id

Page 3: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

3

ANSI -SPARC Three-Level ANSI -SPARC Three-Level ArchitectureArchitecture

http://arief.ismy.web.id

Page 4: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

4

Objectives of Database Objectives of Database ArchitectureArchitecture

►All users should be able to All users should be able to access same access same data but have a different customized data but have a different customized view of the dataview of the data

►Users should Users should not need to knownot need to know physical physical database storage details.database storage details.

►DBA should be able to change DBA should be able to change database database storage structuresstorage structures without affecting the without affecting the users’ views.users’ views.

http://arief.ismy.web.id

Page 5: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

5

►Internal structureInternal structure of database should be of database should be unaffectedunaffected by changes to physical aspects by changes to physical aspects of storage.of storage.

►DBA should be able to change DBA should be able to change conceptual conceptual structurestructure of database without affecting all of database without affecting all users.users.

http://arief.ismy.web.id

Objectives of Database Objectives of Database ArchitectureArchitecture

Page 6: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

-NIM-Name-Address

-CourseCode-CourseName-CourseCredit

-NIM-Semester-CourseCode

NIM Name Semester CourseCode Course Name Credits

Semester

NIM

Course CodeCourse Name Credits Fees

Name

Credits x fee

External SchemaExternal Schema

Conceptual SchemaConceptual Schema

Internal SchemaInternal Schema

External/Conceptual Mapping

Conceptual/Internal Mapping

EX

TER

NA

L L

EV

EL

INTER

NA

L

LEV

EL

CO

NC

EP

TU

AL

LEV

EL

Page 7: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

7

ANSI-SPARC Three-Level ANSI-SPARC Three-Level ArchitectureArchitecture

►External LevelExternal Level Users’ view of the database. Users’ view of the database. Describes that part of database that is Describes that part of database that is

relevant to a particular user.relevant to a particular user.

►Conceptual LevelConceptual Level Community view of the database. Community view of the database. Describes Describes whatwhat data is stored in database data is stored in database

and relationships among the data. and relationships among the data.

http://arief.ismy.web.id

Page 8: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

8

ANSI-SPARC Three-Level ANSI-SPARC Three-Level ArchitectureArchitecture

►Internal LevelInternal Level Physical representation of the database on Physical representation of the database on

the computer. the computer. Describes Describes howhow the data is stored in the the data is stored in the

database. database.

http://arief.ismy.web.id

Page 9: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

9

Data IndependenceData Independence

►Logical Data IndependenceLogical Data Independence Refers to Refers to immunityimmunity of external schemas to of external schemas to

changes in conceptual schema.changes in conceptual schema. Conceptual schema changes (e.g. Conceptual schema changes (e.g.

addition/removal of entities).addition/removal of entities). Should not require changes to external Should not require changes to external

schema or rewrites of application programs. schema or rewrites of application programs.

http://arief.ismy.web.id

Page 10: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

10

Data IndependenceData Independence

►Physical Data IndependencePhysical Data Independence Refers to Refers to immunityimmunity of conceptual schema to of conceptual schema to

changes in the internal schema.changes in the internal schema. Internal schema changes (e.g. using different Internal schema changes (e.g. using different

file organizations, storage structures/devices).file organizations, storage structures/devices). Should not require change to conceptual or Should not require change to conceptual or

external schemas.external schemas.

http://arief.ismy.web.id

Page 11: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

2. Database Languages2. Database Languages

► There are two languages works in DBMS, There are two languages works in DBMS, which are host languages and sublanguages. which are host languages and sublanguages.

► Host languages are high-level programming Host languages are high-level programming languages such as C, C++, C#, Java, VB, etc. languages such as C, C++, C#, Java, VB, etc.

► Sublanguages are languages which exclude Sublanguages are languages which exclude conditional and iterative provided by those conditional and iterative provided by those host languages. DBMS has two sublanguages host languages. DBMS has two sublanguages consisting of Data Definition Language (DDL) consisting of Data Definition Language (DDL) and Data Manipulation Language (DML). and Data Manipulation Language (DML).

11

Page 12: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

12

Data Definition Language (DDL)Data Definition Language (DDL)

DDL is used to DDL is used to specifyspecify the database schema, the database schema, DDL allows the DBA or user to describe and DDL allows the DBA or user to describe and

name name entities, attributes, and relationshipsentities, attributes, and relationships required for the application plus any required for the application plus any associated associated integrityintegrity and and security constraintssecurity constraints..

http://arief.ismy.web.id

Page 13: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

13

Data Manipulation Language (DML)Data Manipulation Language (DML)

DML is used to both DML is used to both readread and and updateupdate the database. the database. DML provides basic DML provides basic data manipulationdata manipulation operations on data held in the operations on data held in the

database.database.

► Procedural DMLProcedural DML allows user to specify what data is needed and how to retrieve the dataallows user to specify what data is needed and how to retrieve the data Allow users to specify how the output of DML should be obtainedAllow users to specify how the output of DML should be obtained Operates on records individuallyOperates on records individually

► Non-Procedural DMLNon-Procedural DML allows user to specify what data is needed regardless how to retrieve the allows user to specify what data is needed regardless how to retrieve the

datadata Allow users to specify what the output of DML should be obtainedAllow users to specify what the output of DML should be obtained Operates on a set of records Operates on a set of records

http://arief.ismy.web.id

Page 14: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

14

Host LanguagesHost Languages

►Fourth Generation Language (4GL)Fourth Generation Language (4GL) Requires fewer linesRequires fewer lines Non-proceduralNon-procedural The user defines parameters, not the stepsThe user defines parameters, not the steps Improve productivityImprove productivity

http://arief.ismy.web.id

Page 15: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

15

4GL4GL

Forms Generators: data inputs & layoutForms Generators: data inputs & layout Report Generators: reportsReport Generators: reports Graphics Generators: graphGraphics Generators: graph Application Generators: programs & Application Generators: programs &

interfaces with databaseinterfaces with database

http://arief.ismy.web.id

Page 16: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

16

Data ModelData Model

Data Model is an Data Model is an integrated collectionintegrated collection of of conceptsconcepts for for describing describing datadata, , relationshipsrelationships between data, and between data, and constraints constraints on the data in an on the data in an organizationorganization..

►Data Model comprisesData Model comprises:: a structural part: rules for constructing DBa structural part: rules for constructing DB a manipulative part: rules for changing DBa manipulative part: rules for changing DB a set of integrity constraints: rules for data a set of integrity constraints: rules for data

accuracyaccuracy

http://arief.ismy.web.id

Page 17: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

Data Model refers to Data Model refers to ANSI SPARC ArchitectureANSI SPARC Architecture

►External Data Model External Data Model record based record based model & object based modelmodel & object based model

►Conceptual Data ModelConceptual Data Model record based record based model & object based modelmodel & object based model

► Internal Data Model Internal Data Model physical data physical data modelmodel

17

Page 18: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

18

Record-Based-Data ModelsRecord-Based-Data Models

Relational Data Model: Related tablesRelational Data Model: Related tables Network Data Model: Related recordsNetwork Data Model: Related records Hierarchical Data Model: Tree structured recordsHierarchical Data Model: Tree structured records

http://arief.ismy.web.id

Page 19: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

19

Page 20: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

20

Page 21: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

21

Page 22: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

Object-Based Data ModelsObject-Based Data Models

Entity-RelationshipEntity-Relationship Semantic Semantic FunctionalFunctional Object-Oriented (chapter 27-29)Object-Oriented (chapter 27-29)

22

Page 23: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

Entity Relationship ModelEntity Relationship Model

23

Students KRStake

NIM NameCours

e Code

Course

Name

Page 24: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

Semantic Relationship ModelSemantic Relationship Model

24

NIM NameCours

e Code

Course

Name

takeStudents KRS

Page 25: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

Functional Relationship Functional Relationship ModelModel

25

int string int string

takeStudents KRS

NIM Course NameCourse CodeName

Page 26: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

Individual HomeworkIndividual Homework

► 2 most common of physical data model are unifying model 2 most common of physical data model are unifying model and frame memory.and frame memory.

►Compare these 2 data modelsCompare these 2 data models

26

Page 27: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

27

Functions of a DBMSFunctions of a DBMSby Codd (1982)by Codd (1982)

► Data storage, retrieval and update: DBMS can Data storage, retrieval and update: DBMS can store, retrieve, and update datastore, retrieve, and update data

► A user accessible catalog: DBMS provides a A user accessible catalog: DBMS provides a catalog which contains descriptions of datacatalog which contains descriptions of data

► Transaction support: DBMS makes sure all Transaction support: DBMS makes sure all updates are processed or ignoredupdates are processed or ignored

► Concurrency control services: DBMS makes sure Concurrency control services: DBMS makes sure database is updated correctly although it’s database is updated correctly although it’s being used by multi usersbeing used by multi users

► Recovery services: DBMS can recover database Recovery services: DBMS can recover database from damagesfrom damages

http://arief.ismy.web.id

Page 28: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

28

Functions of a DBMSFunctions of a DBMS

► Authorization services: DBMS allows Authorization services: DBMS allows authorized users onlyauthorized users only

► Support for data communication: DBMS can Support for data communication: DBMS can integrate with communication softwareintegrate with communication software

► Integrity services: DBMS follows certain rules Integrity services: DBMS follows certain rules in updating databasein updating database

► Service to promote data independence: DBMS Service to promote data independence: DBMS facilitates data independencefacilitates data independence

► Utility services: DBMS provides a set of Utility services: DBMS provides a set of utilitiesutilities

http://arief.ismy.web.id

Page 29: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

Tugas GroupTugas Group

► Membuat aplikasi computer untuk data entry & maintenance pada Membuat aplikasi computer untuk data entry & maintenance pada unit bisnis tertentu.unit bisnis tertentu.

► Aplikasi meng-cover 1 unit/proses business lengkap sesuai topicnyaAplikasi meng-cover 1 unit/proses business lengkap sesuai topicnya► Aplikasi komputer bebas. Aplikasi komputer bebas. ► Dikumpulkan 1 minggu sebelum Kelas terakhir!Dikumpulkan 1 minggu sebelum Kelas terakhir!► Isi paper:Isi paper:► 1. Pendahuluan1. Pendahuluan► 2. Business Proses 2. Business Proses ► 3. Logical,Conceptual,&Physical Design3. Logical,Conceptual,&Physical Design► 4. Aplikasi Design4. Aplikasi Design► 5. Diskusi5. Diskusi► 6. Kesimpulan6. Kesimpulan► 7. Lampiran7. Lampiran

29

Page 30: 1 Chapter 2 Database Environment Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011

Tugas Group-TopikTugas Group-Topik► Perpustakaan (peminjaman, pengembalian, etc)Perpustakaan (peminjaman, pengembalian, etc)► Persewaan Kendaraan (Mobil, alat berat, etc)Persewaan Kendaraan (Mobil, alat berat, etc)► Hotel (booking, reservasi, etc)Hotel (booking, reservasi, etc)► Parkir Parkir ► Ticketing (pesawat, ka, kapal laut, etc)Ticketing (pesawat, ka, kapal laut, etc)► HRD (penggajian, etc)HRD (penggajian, etc)► Toko Toko ► Gudang Gudang ► Asuransi (perhitungan premi, claim premi, etc)Asuransi (perhitungan premi, claim premi, etc)► Bank (kartu kredit, buku tabungam, etc)Bank (kartu kredit, buku tabungam, etc)► Club (Golf, etc)Club (Golf, etc)► Café (Coffee shop, internet café, etc)Café (Coffee shop, internet café, etc)► Travel (schedule, etc)Travel (schedule, etc)► Healt Care (Hospital, Dokter, Dokter gigi, etc)Healt Care (Hospital, Dokter, Dokter gigi, etc)► Manufacturing (plan,produksi, etc) Manufacturing (plan,produksi, etc)

► Kirimkan keKirimkan ke [email protected] subject “TI-403/Nama Kelas/Nama Ketua Kelompok/HAL”subject “TI-403/Nama Kelas/Nama Ketua Kelompok/HAL”

30