Top Banner
Data Model Data Model
29

Sistem Basis Data04

May 30, 2018

Download

Documents

reno doank
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 1/29

Data ModelData Model

Page 2: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 2/29

A relational database matches databy using common characteristics

found within the data set. Theresulting groups of data are organizedand are much easier for people tounderstand.

Page 3: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 3/29

Model dataModel data

Abstract model that describes how dataare represented and accessed.

It show the data semantic and itsrelationships among data. 

Page 4: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 4/29

Data representationData representation

Object-based logical model

› Entity relationship model

› Object-oriented model

› Semantic data model› Functional data model

Record-based logical model

Relational model› Hierarchical model

› Network model

Page 5: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 5/29

Hierarchical modelHierarchical model

Hierarchical model = tree model

Using parent – child model

Parent node can have 1:1 or 1:M relationbut the child node only has one parent

Child node is node under the parent node

Parent node that has no parent is called

ROOTVulnerable to data redundancy

DBMS IMS (IMB)

Page 6: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 6/29

Page 7: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 7/29

Network ModelNetwork Model

consists of entities thats connected bypointer

Pointer = relation Similar to Hierarchical model but one

child is allow to have more than oneparent.

So we can have M:N relation.

Complex

Page 8: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 8/29

Martin Budi Kemiling

KA124 Basis Data

MID123 Struktur Data

LINK

Entity

Page 9: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 9/29

Page 10: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 10/29

Relational modelRelational model

Most popular model nowadays

 The idea is to describe a database as a

collection of predicates over a finiteset of predicate variables, describingconstraints on the values.

Page 11: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 11/29

Page 12: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 12/29

 Tabel is a very natural way to representdata.

 Thats why these model is easy to used.

Page 13: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 13/29

Object-oriented modelObject-oriented model

 This model is inspire by object orientedprogramming

In OOP, object is the main component

Ex : human as an object

information Name, sex, age, DoB.

methodWalk, talk, run, sleep.

Better then procedural

Page 14: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 14/29

OO implement in databaseOO implement in database

Example

Student entity has attribute

Std_NIM, std_Name, std_address,std_mark

 They can have method

› Couting GPA

Page 15: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 15/29

Mahasiswa DataMahasiswa Data

 NIM Student Name Address Date of Birth

980001 Ali Jl . Merdeka 2 Jan 1979

980002 Budi Jl. Gajah Mada 6 Okt 1978

990003 Imam Jl. Asri 13 Mei 1978990004 indah Jl. Adil 21 Juni 1979

What are the characteristic of this table?

Page 16: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 16/29

Column Tipe Size

 NIM char 6

Student Name Char 20

Address Char 15DoB Date 8

Page 17: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 17/29

Lecturer DataLecturer Data

Lecturer Name Address

Martin Budi Jl . Merdeka

Andri Jl. Gajah Mada

Budianto Jl. Asri

Page 18: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 18/29

Column Tipe Size

Lecturer Name char 30

Address Char 20

Page 19: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 19/29

Course dataCourse data

Code Name SKS Semester  

MID123 Struktur Data 4 1

KA146 Sistem Basis Data 4 1

KA123 Akuntansi 2 2IF123 Sistem Operasi Lanjut 2 3

Page 20: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 20/29

Have you see the relationship betweenstudent and course tables?

Column Tipe Size

Code char 6

 Name Char 30

SKS Int 1Semester Int 2

Page 21: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 21/29

Final Mark dataFinal Mark data

Course Name NIM Student Name Final Mark  

Struktur Data 980001 Ali A

Struktur Data 980004 Indah B

Sistem Basis Data 980001 Ali A

Sistem Operasi Lanjut 980002 Budi C

Page 22: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 22/29

 The relationship sample The relationship sample

 The mark table describe therelationship between the studentsand the course they had took.

1 student can have more than 1 course

1 course can be attended by more than1 student

Page 23: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 23/29

Column Name Type Size

Course Name char 20 NIM Int 6

Student Name Char 30

Final Mark Char 1

Page 24: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 24/29

Relationship student-lecturerRelationship student-lecturer

Course Name TIME Location Lecturer  

Struktur Data Senin 07Senin 09

Room 101 Martin

Sistem Operasi Selasa 09 Room 303 Budianto

Sistem Basis Data Selasa 11 Room 201 Martin

Sistem Operasi Lanjut Rabu 07 Room 102 Andri

Page 25: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 25/29

 The relationship sample The relationship sample

 The time table describe the relationshipbetween the lecturers and the course.

one lecturer can have more than onecourse

one course is taught by one lecturer

Page 26: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 26/29

Column Name Type Size

Course Name char 20Time Int 20

Location Char 15

Lecturer Char 30

Page 27: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 27/29

Company has few departments, Each of them has name, unique number,employee, Start date

Department has many locations,Department control few projects thathave name and unique number and in

one place

Page 28: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 28/29

Employee has name, social securitynumber, address, salary, sex andbirth date.

Employee works for one departemenbut it is possible to works in manyprojects in deferent departement .

Page 29: Sistem Basis Data04

8/14/2019 Sistem Basis Data04

http://slidepdf.com/reader/full/sistem-basis-data04 29/29