Hierarchical Database Model by 2P2nbI

VIEWS: 10 PAGES: 27

									Data Structure Concepts
 Record
    Collection of field values
    Grouped as record types


 Parent-Child Relationships
    1:N
        Occurrence : ONE parent and zero or more children
        Notation : (parent record type, child record type)
 Hierarchical Diagram
                              Department
        DNAME       DBNUMBER       MGR_ID      MGRSTARTDATE



   (Department, Employee)                      (Department, Project)



             Employee                                  Project
NAME    ID     ADDRESS      STARTDATE      PNAME   PNUMBER       PLOCATION
Properties of Hierarchical Schema
 Root record type
    Top of tree
    Not a child of any other record type


 Parent record type can have multiple children
    Child record types are ordered


 A record type that does not participate as a parent
  record type is called a leaf
Occurrences of Parent-Child
Relationships
Research Department        Administration Department
 (Department, Employee)    (Department, Employee
    Smith                     Jones,
    Wang                      Wallace
    English                   Kirk


 (Department, Project)     (Department, Project)
    ProductX                  NewBenefits
    ProductY                  Computerization
    ProductZ
Data Manipulation Language
 Record -at- a- time language


 GET (FIRST | NEXT) <record type>
   [WHERE <condition>]


 GET (FIRST|NEXT) PATH <hierarchical path>
   [WHERE <condition>]
Data Manipulation Language
 INSERT


 DELETE


 REPLACE
Data Structure Concepts
 Record
    Collection of related data values

 Record Types
    Classified into record types
        Store the same type of information



 Data Item
    Data name and format

 Relationships are represented as links
Set Type Diagram
                                         Owner Record Type
                   Department
   DNAME   DBNUMBER    MGR_ID     MGRSTARTDATE

                           Major_Dept

                                        Member Record Type

                       Student
           NAME   ID   ADDRESS    STARTDATE
Member Records
 Ordered                                     CS Department ▪ ▪ ▪



   Think of as “linked”          Dannelly        ▪ ▪ ▪



                         Foster           ▪ ▪ ▪



               Olsen              ▪ ▪ ▪



     Thacker           ▪ ▪ ▪
M: N Relationships
 Employees can work on more than one project
                      W1
       E1                             P1
                      W2

      E2              W3              P2
                      W4
      E3                              P3
                      W5

      E4              W6              P4
                      W7
M: N Relationships
E1   ▪ ▪ ▪   w1   ▪▪▪   P1    ▪ ▪ ▪


             w2   ▪▪▪

             w3   ▪▪▪   P2    ▪ ▪ ▪
E2   ▪ ▪ ▪

             w4   ▪▪▪

                        P3    ▪ ▪ ▪
E3   ▪ ▪ ▪   w5   ▪▪▪

             w6   ▪▪▪

                        P4
                         P4   ▪ ▪▪ ▪▪ ▪
             w7   ▪▪▪
E4   ▪ ▪ ▪
Data Manipulation Language
 FIND (FIRST | LAST | PRIOR | NEXT)


 GET


 Record Updates
    STORE
                          Set Update
    ERASE                   CONNECT

    MODIFY                  DISCONNECT
                             RECONNECT
Active Database
 Event-based rule processing. The behavior of an active
  database is accomplished through a set of ECA-rules
  (Event-Condition-Action rules) related with the
  database.
 An active database gains its power from the array of
  events it can respond to and the type of actions it can
  perform in response.
 Active databases support the creation of triggers which
  fire when certain operations occur on the database.

                                   http://it.toolbox.com/wiki/index.php/Active_Database
Fundamental features
 Events
    Primitives for database state changes
        Monitor retrievals, time-related, application defined, etc


 Conditions
    Database predicate or query
    Returns a truth value


 Actions
    Arbitrary data manipulation program
Temporal Database Concepts
 Encompass all database apps that require some aspect
  of time when organizing information.
 Example:
   Name     Salary    Title    Start      Stop
   Bob      1000      Tech1    01/12/09   06/01/09
   Bob      1000      Tech2    01/12/09   06/01/09
   Bob      300       Tech3    06/01/09   01/01/10


   What is Bob’s salary history?
   Provide the salary and department history for all
    employees.
 Time is considered to be an ordered sequence of points
  in some granularity.
    chronon
 Represent as an
    Age: requires a reference starting point
    Period: nt time via a time period

								
To top