Slide 2 data models

23
Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW DATA MODELS

description

data models

Transcript of Slide 2 data models

Page 1: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

DATA MODELS

Page 2: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

DATA MODELS

• Abstract form of any system• Conceptual tool for describing data, data relationship, semantics, consistency constraints

Page 3: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Type of DATA MODELS

1)Hierarchical Model2)Network Model3)Relational Model4)ER Model5)Object Oriented Model6)Object Relational Model7)Deductive / Inference Model

Page 4: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

1)Hierarchical Model

•Oldest data base model. (1950’s)• Tree structure is most frequently occurring relationship.• organize data elements as tabular rows

Page 5: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Advantages• Simplicity• Data security• Data Integrity• Efficiency : When contains large no of relations

Disadvantages• Implementation complexity• Database management problem : maintaining difficult• Lack of structural independence • programming complexity• Implementation problems (N:N difficult, only 1:N)

Page 6: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 7: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 8: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

2) Network Model

• Graph structure• Allow more connection between nodes• Ex: A employee work for two department is not possible in hierarchical model, but here it is possible

Page 9: Slide 2 data models

Advantages• Conceptual simplicity• handle more relationships• Ease of data access• Data integrity : does not allow a member to exist without an owner• Data independence : isolate programs from complex physical storage• Database standards : like DDL, DML

Disadvantages• System Complexity : not user friendly, navigation difficult, user must familiar with internal structure • Absence of structural independence :database structure change then modify application program

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 10: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 11: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

3) Relational Model

•Data in the form of table• each table application entity• each row instances of that entity• SQL serves as a uniform interface for users providing a collection of standard expression for storing and retrieving data • Most popular database model

Page 12: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Formal Relational terms Informal Equivalence

Relation Table

Tuple Row/record

Cardinality of relation Number of rows

Attribute Columns/field

Degree of relation Number of columns

Primary Key Unique identifier

Domain A pool of values from which the values of specific attributes of specific relations are taken

Page 13: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 14: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Advantages• Structural independence• Conceptual simplicity• Design , implementation , maintenance and usage ease• Adhoc Query capability

• Very powerful• Flexible• Easy to use query capability

>SQL : makes adhoc queries a reality : It is 4GL

Page 15: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Disadvantages• Hardware Overheads (Today it is not a big deal…)• Ease of design leads to bad design• Information island phenomena

• It will prevent information integrity• cause redundancy• cause inconsistency

Page 16: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

4) Object oriented model

• Handling complex information• represents entity as a class• Suited for•Multimedia applications• Complex relation relationships• can hold data,text,pictures,voice and

video

Page 17: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 18: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Advantages• Large number of different data types• Its features improve productivity• Inheritance• Polymorphism• Dynamic binding

Disadvantages• Difficult to maintain : schema migration(real world data model is not static)• Not suited for all applications(Performance degradation may happen)

Page 19: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

5) Object relational model

• Combines the advantages of relational database + Object oriented programming• Database and is manipulated collectively with queries

+ A programming API for storing and retrieving objects

Page 20: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

6) Deductive model

• It can make deductions (i.e., conclude additional facts) based on rules and facts stored in the (deductive) database

• Datalog : is the language typically used to specify facts, rules and queries in deductive databases

Page 21: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

7) ER model• Developed by Peter Chen and published in a 1976 paper• Defines the conceptual view of database• It works around real world entity and association among them• At view level, ER model is considered well for designing databases.• Terminologies :• Entity• Attribute

• Simple attribute:• Composite attribute:• Derived attribute:• Single-valued attribute:• Multi-value attribute:

• KEYS : PRIMARY KEY, SUPER KEY, FOREIGN KEY, CANDIDATE KEY• CARDINALITIES

Page 22: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Page 23: Slide 2 data models

Prepared by Visakh V, Assistant Professor,Dept. of CSE, LBSITW

Advantages • Easy to understand• Helps in physical database creation

Disadvantages

• May contain some amount of ambiguities or inconsitency.• Sometimes diagrams may leads to misinterpretations.