NETWORK MODEL by icf1n7h

VIEWS: 7 PAGES: 5

									                                   NETWORK MODEL
                              (CO Dasyl Model – DBTG Model)

CODASYL: Conference on Data System Language.

DBTG: Database Task Group.

Data-item                DEPTT NAME, etc.
Record                   DEPTT, FACULTY STUDENT
Set                      APPOINTMENT, MAJOR, ADV.
Set-member               FACULTY, STUDENT, STUDY
Set-owner                DEPTT, DEPTT, FACULTY
                                    DN

                 owner              DEPARTMENT
                                                         owner
                          APPOINTMENT
      member
                                         MAJOR
                         FACULTY

             owner       ADVISOR
                                                          member
                                         STUDENT
                           member




                         WARD                  DOCTOR


                     OCCUPANCY                 ATTENDING DOCTOR

                                     PATIENT
                       W1                  W2              W3                 W4




        P1        P2        P3   P4   P5        P6    P7   P8   P9     P10    P11     P12



             D1                  D2             D3    D4   D5                 D6


                                                                      Owner         Member

                  Ward                               Occupancy ----                 P

         ^        DOCTOR                             Attending doctor               P

         P        Patient


Characteristics of a SET
   1. A set is a collection of records.
   2. Each set has one owner record type and one or more member record types.
   3. Each owner record occurrence defines a set occurrence.
   4. A record may be a member of more than one set type.
   5. A record may not be a member of two occurrences of the same set type.
   6. A record may not be a member and an owner of the same set type.
   7. A record may own more than one set.
Many – Many relationships cannot be represented in DBTG set concepts.
Solution: Create a new record type which holds intersection data.

ONLY BINARY – MANY ONE RELATIONSHIPS ARE ALLOWED. Restrictions are as
follows:
   1. A record may own more than one set.
   2. A set may have more than one record as a member BUT only one owner.
   3. A record may be a member of more than one set type.
   4. A record may not be a member AND an owner of the same set type.
   5. Cycles are allowed in the CODASYL Model.
                                    Record Identified By



                   Currency            Location Mode        Logical Position



                 DIRECT                Via Set Name          CALCULATION



                   Current of Set            Location Mode of Owner




                                                  Location mode is CALC
                DEPT                              Using Dept-Name

                                                  Set occurrence selected by
                        APPOINTMENT
                                                  Location Mode of DEPT.

              FACULTY                             Location mode is via APPOINT.

                                                  Set OCCURRENCE selected by
                            ADVISOR               Faculty Location Mode.

               STUDENT                            Location Mode is via. ADV.



Mandatory – Manual
     Can be included anytime. Once included, must belong to a set occurrence at all times.

Mandatory – Automatic
     Must be included when created. Once included, must belong to a set occurrence at all
     times.

Optional – Manual
      Can be included anytime.
      Can be detached anytime.

Optional – Automatic
      Must be included when created.
      Can be detached anytime.
MANUAL:
    Explicitly included via DML.
    Patient (P8) does not have to be assigned to a doctor.

AUTOMATIC:
    When member is created, it must be made a member of sets in which it is declared
    automatic. Patient must be assigned a ward.

OPTIONAL: (Transient in Book):
     Removed or inserted by DML. Patient can be discharged from a doctor and does not have
     to get a doctor while he is still in the hospital.


MANDATORY: (Permanent in Book):
    Cannot be removed from a set occurrence unless deleted or moved to another set
    occurrence.

Get <record type> ; <list of fields>
FIND <record type> Record by DB Key <var>
FIND <             > Record by Key
FIND DUPLICATE <record type>
FIND OWNER OF CURRENT <set name> SET
FIND FIRST/NEXT <record type> RECORD IN CURRENT <set name> SET
FIND DUPLICATE <                   > RECORD IN CURRENT <set name> SET USING <field list>
Establishing a Current of Run Unit
FIND CURRENT OF <set name> SET
FIND CURRENT OF <record type> RECORD


STORE T: (After establishing a current of a SET)
    INSERT T INTO S
    REMOVE T FROM S
    MODIFY <record type> ; <field list>
    DELETE <record type> ALL ← could delete the whole database

SINGULAR SETS
     OWNER IS SYSTEM
     MEMBER IS <Record Type>;
Print “Student Name”, “Grade”
Find first student record in current Allstudents SET

While  Fail do
      Get Students
      If Grade < B then
      Print Name of Student, Grade
      FIND NEXT Student Record in Current AllStudents SET

           SET ALLSTUDENTS
           OWNER IS SYSTEM
           MEMBER IS STUDENTS

								
To top