25 May 2016

Distributed Database Management System Data Model

Data Model

  • A set of tools/ constructs used to model a database
  • Record/Semantic

Legacy Data Models

  • Hierarchical
  • Network
  • Relational

Relational Data Model

  • Two major Strengths
  • Three Components
  • Relational databases based on relational Data Model
  • A relation R defined over domains D1, D2, …., Dn is a set of n-tuples, <d1, d2, …, dn> such that <d1 clip_image002[4] D1……, dnclip_image002[5]Dn

Schemes in RDB

  • EMP(eNo, eName, eTitle, eSal, pNo, eResp, pDur)
  • PROJ(pNo, pName, bud)
  • Each of the attribute in these two relations has a domain, like…
  • Domains need not to be distinct

Keys

Primary Key

  • Minimum nonempty subset of a relation whose values uniquely identify each tuple in relation
  • The superset of the key is super key, like…
  • We also have candidate, alternate, secondary, foreign

Table

  • Relation represented in a two dimensional form

EMP

image

PROJ

image

image

  • After defining a relation’s scheme, it is populated
  • Tuples are rows and attributes are cols
  • Attributes get values from same domain
  • Can have NULL value, but….

Normalization

  • Step-by-step reversible process to produce anomalies free smarter tables
  • Anomalies Types….
  • Major step is decomposition
  • Universal Relation approach
  • Three Normal Forms
  • BCNF
  • Lossless decomposition
  • Dependency preservation

Dependency Structure

  • Norm. based on dependencies
  • Up to BCNF on FDs
  • MVD and P-JD

Dependencies

  • A relation R defined on attributes A(A1, A2, …., An), if Xclip_image002[8]A, Yclip_image002[9]A, if for each value of X
  • There is a unique value in Y, then X functionally determines Y, Xclip_image002[12] Y
  • If X clip_image002[16] Y and there is a Z clip_image004X and Z clip_image002[17]Y, then X partially determines Y or Y is partially dependent on X
  • A relation R defined on attributes A(A1, A2, …., An), if X clip_image002[20]A, Y clip_image002[21]A, Z clip_image002[22]A, if for each value of X
  • There is unique value of (Y,Z) pair and Z depends only on X then X multi determines Z, X clip_image002[26]Z

P-J Dependency

  • A relation R defined on attributes A(A1, A2, …., An), if X clip_image002[29]A, Y clip_image002[30]A, Z clip_image002[31]A, if R is equal to join of X, Y and Z then (X, Y, Z) constitute project-join dependency for R
  • 1NF, attributes have only atomic values
  • 2NF, there are no partial dependencies
  • 3NF, for each X clip_image002[35]Y where Y is not in X, either X is a superkey of R or Y is prime attribute

No comments:

Post a Comment