Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Models.

Similar presentations


Presentation on theme: "Data Models."— Presentation transcript:

1 Data Models

2 A description of a database is known as Schema.
What is Schema ??? A description of a database is known as Schema.

3 What is Instance ??? Record at a particular moment of time in a database is known as Instance.

4 What is Data Model??? A data model is an abstract model that describes how data is represented and accessed.

5 Meanings of Data Model Data Model Theory Data Model Instance

6 A formal description of how data may be structured and accessed
Data Model Theory A formal description of how data may be structured and accessed

7 Components of Data Model Theory
Structural Part (data structure used to create databases representing entities or modeled by database using create command ) Integrity Part (rules governing the constraints placed on these data structures like applying constraints such as primary key , foreign key) Manipulation Part (a collection of operators used to manipulate the database using queries and update command)

8 Example of Relational Model
Structural Part (based on modified concept of mathematical relation) Integrity Part (by using first order logic) Manipulation Part (using relational algebra , tuple calculus and domain calculus)

9 Data Model Instance Data Modeling is the process of creating a data model instance by applying a data model theory.

10 It involves structuring and organizing the data.
Data Modeling It is a process of creating a data model by applying data model theory to create a data model instance. It involves structuring and organizing the data.

11 High Level (Conceptual Schema) Low Level (Physical Schema)
Types of Data Model High Level (Conceptual Schema) Low Level (Physical Schema) Representational Data Model Hierarchical Relational Networked ( Logical Schema )

12 Conceptual Schema It is used to describe the semantics of a domain, being the scope of the model. It consists of Entity Classes and relationships among these entities.

13 Logical Schema It describes the semantics as represented by the particular data manipulation technology. It consists of description of tables , columns object oriented classes etc.

14 Physical Schema It describes the physical means by which data is stored. It is concerned with partitions , table spaces etc.

15 Zachman Framework Contextual List (List of Important Things)
Conceptual Model (Entities & Relationships) Logical Model (attributes & identifiers) Physical Model (keys , storage requirements) DDL (Configuration Listing) Data Instances (Operations Storage) Zachman Framework

16 What is Logical Data Model???
A data model is an abstract model that describes how data is represented and accessed.

17 Graphical Representations of the business requirements
Contains the things of importance in an organization and how they relate to one another Contains business textual definitions and examples Validated and approved by a business representative Basis of Physical Database design

18 Logical Data Model Vs Physical Data Model
Includes Entities ,attributes and relationships Includes tables,columns,keys,data types,validation rules,database triggers stored procedures and access controls Uses business names for attributes Uses column names limited by DBMS Is independent of technology Includes Primary key and indices for fast data acces

19 Is normalized to 4th Normal Form.
Can be de normalized to meet performance requirements Does not include any redundant or derived data May include redundant columns Business subject matter experts validate and approve the model Physical modeler lead the modeling activity

20 Why build Logical Data Model???
Helps common understanding of business requirements Provides foundation for designing a database Facilitates data re use and sharing Decreases development and maintenance time and cost Confirms a logical process model and helps impact analysis

21 Logical Modeling Benefits
Clarifies functional specifications and avoid assumptions Confirms Business requirements Facilitates business process improvement Decreases system development time and cost Data re-using and sharing Gathers Metadata

22 3 Schema Architecture of DBMS
View 1 View 2 High Level DM Representational DM High Level DM Conceptual Layer Internal Layer Low Level DM

23 What is Data Independence???
It is a capability to change a specific layer without affecting the other two layers.

24 Types of Data Independence
Logical Data Independence Physical Data Independence

25 Logical Data Independence
The capability to change a conceptual layer without affecting the other two layers

26 Physical Data Independence
Capability to change physical layer without affecting the other two layers

27 It is database model proposed by Dr. E F Codd.
Relational Data Model It is database model proposed by Dr. E F Codd. Core idea is to organize data into tables rows and columns). Follows simple concept of relational algebra

28 Networked Data Model It is a database model conceived as a flexible way of representing objects and their relationships. It was invented by Charles Bachman. NM allows each record to have multiple parent and child records forming a lattice structure.

29 Hierarchical Data Model
Data is organized in a tree like structure. It allows repeating information using parent/child relationships. Each parent can have multiple child but each child has single parent. It uses 1:N mapping also known as one to many relationships.

30 Object Oriented Data Model
Data and associated operations are represented by objects. An object is an identifiable entity with some characteristics and behavior.

31 What Is Relation ??? A relation is defined as a set of n tuple (rows) which stores the data logically in a 2-D format in forms of rows and columns.

32 Relation : Employee Attributes : Emp_id , ename , designation ,dept Emp_id ename designation dept E001 Raghav AM Civil E002 Smriti MANAGER HR E003 Ashwin DM Finance

33 Relational Algebra Projection Selection Union Intersection Difference Cartesian Product

34 Two relations A and B are said to be union compatible if and only if
Union Compatibilty Union Compatible relations are those relations which have same domain and degree. Two relations A and B are said to be union compatible if and only if Deg(A)=Deg(B) Dom(a1)=dom(b1) Dom(a2)=dom(b2) .. Dom(an)=dom(bn)

35 Cardinality No of rows in a relation.

36 One to one (1 : 1) One to many (1 : M) Many to many (M:N)
Cardinality Ratio One to one (1 : 1) One to many (1 : M) Many to many (M:N)

37 Referential Integrity Key Constraints.
Types of Constraints Entity Integrity Referential Integrity Key Constraints.

38 Types Of Key Constraints
Super Key Candidate key Primary Key Alternate Key Foreign Key

39 A super key is written as a finite set of attribute names.
A super key K holds in a relation (H,B) if: K is proper subset of H and There exists two distinct tuples t1 and t2 which must hold the condition T1[k] = t2[k]

40 Data Modeling Techniques
ER diagrams EER diagrams OMT

41 E R Diagram Works_in Department Employee

42 Single Valued / Multivalued Stored and Derived
Types of Attributes Atomic and Composite Single Valued / Multivalued Stored and Derived

43 Types of Entities Strong Entity Weak Entity

44 Types of Participation Constraints
Total Participation Partial Participation

45 Example Database Customer(Customer_id,Tax_id,Name,Address,City,State,
Zip,Phone) Order(Orderno,Cust_id,invoice_no,date placed,date promised,terms,status) Order Line(Orderno,Orderlineno,product code,qty) Invoice(Invoice_no,Cust_id,Order_no,date,Status) Invoice Line(Invoiceno,lineno,product_code,qty,shipped) Product(Product_code,prod_desc)


Download ppt "Data Models."

Similar presentations


Ads by Google