Sistem Basis Data04

Post on 30-May-2018

219 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

8/14/2019 Sistem Basis Data04

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

Data ModelData Model

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.

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. 

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

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)

8/14/2019 Sistem Basis Data04

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

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

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

8/14/2019 Sistem Basis Data04

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

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.

8/14/2019 Sistem Basis Data04

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

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.

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

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

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?

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

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

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

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

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

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

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

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

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

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

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

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

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 .

8/14/2019 Sistem Basis Data04

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

top related