Data Model

A relational database matches data by using common characteristics found within the data set. The resulting groups of data are organized and are much easier for people to understand.

Model data
model that describes how data are represented and accessed.  It show the data semantic and its relationships among data.  
  Abstract

Data 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

Hierarchical model
 Hierarchical model = tree model  Using parent – child model  Parent node can have 1:1 or 1:M relation but the child node only has one parent  Child node is node under the parent node  Parent node that has no parent is called ROOT
 Vulnerable

to data redundancy  DBMS IMS (IMB)

Network Model
 consists

of entities thats connected by pointer  Pointer = relation  Similar to Hierarchical model but one child is allow to have more than one parent.  So we can have M:N relation.  Complex

MID123 Martin Budi Kemiling KA124
Entity LINK

Struktur Data

Basis Data

Relational model
 Most

popular model nowadays  The idea is to describe a database as a collection of predicates over a finite set of predicate variables, describing constraints on the values.

 Tabel

is a very natural way to represent data.  Thats why these model is easy to used.

Object-oriented model
 This model is inspire by object oriented programming  In OOP, object is the main component   Ex : human as an object
 information
 Name, sex, age, DoB.

method
Walk, talk, run, sleep.

 Better then procedural

OO implement in database
 Example  Student

entity has attribute

› Std_NIM, std_Name, std_address,

std_mark

 They

can have method

› Couting GPA

Mahasiswa Data
NIM 980001 980002 990003 990004 Student Name Ali Budi Imam indah Address Jl . Merdeka Jl. Gajah Mada Jl. Asri Jl. Adil Date of Birth 2 Jan 1979 6 Okt 1978 13 Mei 1978 21 Juni 1979

What are the characteristic of this table?

Column NIM Student Name Address DoB

Tipe char Char Char Date

Size 6 20 15 8

Lecturer Data
Lecturer Name Martin Budi Andri Budianto Address Jl . Merdeka Jl. Gajah Mada Jl. Asri

Column Lecturer Name Address

Tipe char Char

Size 30 20

Course data
Code MID123 KA146 KA123 IF123 Name Struktur Data Sistem Basis Data Akuntansi Sistem Operasi Lanjut SKS 4 4 2 2 Semester 1 1 2 3

Column Code Name SKS Semester

Tipe char Char Int Int

Size 6 30 1 2

 Have

you see the relationship between student and course tables?

Final Mark data
Course Name Struktur Data Struktur Data Sistem Basis Data Sistem Operasi Lanjut NIM 980001 980004 980001 980002 Student Name Ali Indah Ali Budi Final Mark A B A C

The relationship sample
 The

mark table describe the relationship between the students and the course they had took.  1 student can have more than 1 course  1 course can be attended by more than 1 student

Column Name Course Name NIM Student Name Final Mark

Type char Int Char Char

Size 20 6 30 1

Relationship student-lecturer
Course Name Struktur Data Sistem Operasi Sistem Basis Data Sistem Operasi Lanjut TIME Senin 07 Senin 09 Selasa 09 Selasa 11 Rabu 07 Location Room 101 Room 303 Room 201 Room 102 Lecturer Martin Budianto Martin Andri

The relationship sample
 The

time table describe the relationship between the lecturers and the course.  one lecturer can have more than one course  one course is taught by one lecturer

Column Name Course Name Time Location Lecturer

Type char Int Char Char

Size 20 20 15 30

 Company

has few departments, Each of them has name, unique number, employee, Start date  Department has many locations, Department control few projects that have name and unique number and in one place

 Employee

has name, social security number, address, salary, sex and birth date.  Employee works for one departemen but it is possible to works in many projects in deferent departement .