THE NETWORK DATA MODEL SECTION 8 An early DBMS. Background Networks are a natural way of representing relationships among objects The network data model.

Slides:



Advertisements
Similar presentations
Relational Database and Data Modeling
Advertisements

Chapter A: Network Model
Unit 5 The Network Model  5.1 The Network Model  5.2 IDMS.
Chapter 12 File Processing and Data Management Concepts
©Silberschatz, Korth and SudarshanA.1Database System Concepts, 5 th Ed. Appendix A: Network Model.
Accounting System Design
Relational Databases Chapter 4.
Chapter 16 The Hierarchical and Network Data Models David M. Kroenke Database Processing © 2000 Prentice Hall.
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Teleprocessing.
Databases and Processing Modes. Fundamental Data Storage Concepts and Definitions What is an entity? An entity is something about which information is.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter One Overview of Database Objectives: -Introduction -DBMS architecture -Definitions -Data models -DB lifecycle.
LECTURE 2 DATABASE SYSTEM CONCEPTS AND ARCHITECTURE.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Network Model By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
Chapter 2 CIS Sungchul Hong
Chapter 2 Database Environment
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single.
Concepts and Terminology Introduction to Database.
A.1 Chapter A: Network Model Basic Concepts Data-Structure Diagrams The DBTG CODASYL Model DBTG Data-Retrieval Facility DBTG Update Facility DBTG Set-Processing.
Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Rob and Coronel Adapted for INFS-3200.
I Information Systems Technology Ross Malaga 4 "Part I Understanding Information Systems Technology" Copyright © 2005 Prentice Hall, Inc. 4-1 DATABASE.
10/21/2015 M Sliming 1 Intro to IDMS Margaret Sliming.
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Data Dictionary.
1.1 CAS CS 460/660 Relational Model. 1.2 Review E/R Model: Entities, relationships, attributes Cardinalities: 1:1, 1:n, m:1, m:n Keys: superkeys, candidate.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Relational Database. Database Management System (DBMS)
CS 1308 Computer Literacy and the Internet
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
Chapter 9 Database Systems Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Database revision.
Unit 5 The Network Model  5.1 Data Modeling Issues  5.2 The Network Model  5.3 IDMS.
Hierarchical Model By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
1Mr.Mohammed Abu Roqyah. Database System Concepts and Architecture 2Mr.Mohammed Abu Roqyah.
Database Environment Session 2 Course Name: Database System Year : 2013.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
©2003 Prentice Hall Business Publishing, Accounting Information Systems, 9/e, Romney/Steinbart 4-1 Relational Databases.
DataBase System Concepts and Architecture
©2003 Prentice Hall Business Publishing, Accounting Information Systems, 9/e, Romney/Steinbart 4-1 Relational Databases.
Logical Database Design and the Relational Model.
Chapter 2 Database Environment.
1 Chapter 2 Database Environment Pearson Education © 2009.
Chapter 3: Relational Databases
Presentation on Database management Submitted To: Prof: Rutvi Sarang Submitted By: Dharmishtha A. Baria Roll:No:1(sem-3)
Database Environment Chapter 2. The Three-Level ANSI-SPARC Architecture External Level Conceptual Level Internal Level Physical Data.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
Data Resource Management Data Concepts Database Management Types of Databases Chapter 5 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies,
Fundamentals of DBMS Notes-1.
Chapter 2 Database Environment.
Appendix D: Network Model
Chapter 4 Relational Databases
Chapter 2 Database Environment.
Chapter 2 Database Environment Pearson Education © 2009.
Basic Concepts in Data Management
Chapter 2 Database Environment.
Accounting System Design
Data Model.
Accounting System Design
Accounting Information Systems 9th Edition
Appendix D: Network Model
Chapter 2 Database Environment Pearson Education © 2014.
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 2 Database Environment Pearson Education © 2009.
Presentation transcript:

THE NETWORK DATA MODEL SECTION 8 An early DBMS

Background Networks are a natural way of representing relationships among objects The network data model represents data in network structures of record types connected in one-to-one or one-to-many relationships

Conference on Data Systems Language Early 1960s American Standards Institute (ANSI) – 1971 IDS and IDMS

Concepts Schema Subschema Physical details

Records and Sets Record type Set Owner record type Member record type

A Bachman Diagram A Data Structure Diagram CUSTOMER PURCHASE-ORDER LINE-ITEMS SALESPERSON OWNER MEMBEROWNER MEMBER SALESPO SET CUSTPO SET POITEM SET One-to-many relationship One-to-one relationship

Instance or Occurrence SmithJonesBean PO #1PO #2PO #3PO #4 PensPencilsErasersEnvelopes DarwinWallace CUSTOMER SALESPERSON An Example of a Network Data Structure

Types of Networks Simple networks Complex networks Link record type

An Example of a Link Record STUDENT CLASS Thus a complex network STUDENT STUDENT- ID CLASS CLASS-ID TAKING CLASS SET ENROLLED SET SC

Expanded Example Sue WhiteJudy Dench PBA461 Peter Black PBE230SWA461SWE230JDA461PBB304 Botany 304English 230 Accounting 461 Converts a complex network into a simple network

The Model’s Relationship to Conceptual Modeling Semantics An example of a conceptual model? CUSTOMERACCOUNT HAS- ACCOUNT 1N CUST-IDNAMEADDRESSACCT #BALANCE CUST-IDNAMEADDRESSBALANCEACCT # CUSTOMERACCOUNT CUSTOMER/ACCOUNT SET

RULE 1 For each entity of set E in a conceptual schema, create a record type R in the network data structure. All attributes of E are represented as fields in R

Representing One-to-Many Relationships CUSTOMERACCOUNT CUSTOMERACCOUNT RULE 2 For one-to-many relationships, the record type on the “one” side of the relationship becomes the owner, the record type on the “many” side becomes the member record type. If the relationship is strictly one-to-one, then the owner and member record types are chosen arbitrarily.

Transforming n-ary Relationships An example could be a three-way relationship PRODUCT DATE COUNTRY SOLD NM M

Must create a link record PRODUCTDATECOUNTRY LINK RECORD Product/Link Set Date/Link Set Country/Link Set RULE 3 For each n-ary relationships, n > 2, create a linking record L, and make it the member record type in n set types. Designate the owner of each set type as the record type on the “one” side of the resulting on-to-many relationship.

Nov. 2, 1999Jan. 15, 2000Jan Dec. 5, 1999 DATES LINK 1 LINK 2 LINK 3 LINK 4 Australia Canada USA Widget Clamp Gadget PRODUCTSCOUNTRIES The Database from the above example

Transforming Many-To-Many Relationships An manufacturer may produce many products, and any one of these products can be made by several manufacturers MANUFACTURERPRODUCT RULE 4 For each may-to-many relationship between entity sets E 1 and E 2 create a link record type L and make it the member record type in two set types, of which the set type owners are the record types corresponding to E 1 and E 2.

MANUFACTURERPRODUCT LREC Product/LRec SetManufacturer/LRec Set Ron Smith 450 Maple St. Gamma, Inc 68 Main St.. Bean Mfg. 26 Harris Ave. 115Widget 116Clamp 120Gadget MANUFACTURERPRODUCT LREC

Data Definition Language What is the DDL? Use the DDL to define the database schema The following procedure should be used.

Procedure Create the conceptual data model Map the conceptual data model to network data structure diagrams Use the DDL to implement the schema

A schema is made up of: Schema section Record sections Set sections

1.Create the conceptual model CUSTOMER LINE-ITEM INVOICE HAS- INVOICE 1M 1 CONTAINS M

2.Map to a network structure CUSTOMER LINE-ITEM INVOICE CUSTINV INVITEM

3.Implement the schema 1.SCHEMA NAME IS ACCOUNTSREC 2.RECORD NAME IS CUSTOMER 3.CUST-IDTYPE ISNUMERIC INTEGER 4.NAMETYPE ISCHARACTER 15 5.ADDRESSTYPE ISCHARACTER 20 6.ACCOUNT-BALANCETYPE ISNUMERIC (5,2) 7.RECORD NAME IS INVOICE 8.INVONOTYPE ISNUMERIC INTEGER 9.DATETYPE ISCHARACTER 9 10.AMOUNTTYPE ISNUMERIC (5,2) 11.STATUSTYPE ISCHARACTER 2 12.RECORD NAME IS LINE-ITEM 13.STOCKNOTYPE ISNUMERIC INTEGER 14.DESCRIPTIONTYPE ISCHARACTER PRICETYPE ISNUMERIC (4,2) 16.CUSTINV 17.OWNER IS CUSTOMER 18.MEMBER IS INVOICE 19.INVITEM 20.OWNER IS INVOICE 21.MEMBER IS LINE-ITEM

From Schema to Subschema Title division Mapping division Structure division Subschema record section Subschema set section

Subschema Example SS INVSTATUS WITHIN ACCOUNTSREC. MAPPING DIVISION. ALIAS SECTION. AD RECORD CUSTOMER IS OWEDBY. AD SET CUST-INV IS OWEDBY – INV. STRUCTURE DIVISION. RECORD SECTION. 01OWEDBY. 05CUST-ID. 05NAME. 05ACCOUNT-BALANCE. 01INVOICE ALL. SET SECTION. SDOWEDBY-INV

Data Manipulation Language What is the DML? Process records one at a time The following procedure should be used.

Basic Commands Navigational commands Retrieval commands Update commands Records Sets

Basic DML Commands FIND GET ERASE STORE MODIFY CONNECT DISCONNECT RECONNECT Command Navigation Retrieval Record Update Set Update Type

Some terms defined User working area Currency indicators Status flags Record templates

14Bean150 OWEDBY TEMPLATE INVOICE TEMPLATE OWEDBY INVOICE OWEDBY- INVOICE RUN-UNIT CURRENCY POINTERS 10Smith100 14Bean150 16Black User Working Area in Primary Memory OWEDBY INSTANCES INVOICE INSTANCES Relationship of User Working Area to Database Instances

Retrieval and Update FIND Command GET Command MOVE 105 TO CUST-ID IN CUSTOMER FIND ANY CUSTOMER USING CUST-ID GET CUSTOMER A Simple Record Retrieval

MOVE 0 TO ACCOUNT-BALANCE IN CUSTOMER FIND ANY CUSTOMER USING ACCOUNT-BALANCE DOWHILE DB-STATUS = 0 GET CUSTOMER (process customer record) FIND DUPLICATE CUSTOMER USING ACCOUNT-BALANCE END-DO Retrieval of all Records with a Particular Characteristic

ERASE Command MOVE 0 TO ACCOUNT-BALANCE IN CUSTOMER FIND FOR UPDATE ANY CUSTOMER USING ACCOUNT-BALANCE DOWHILE DB-STATUS = 0 ERASE CUSTOMER FIND FOE UPDATE DUPLICATE CUSTOMER USING ACCOUNT-BALANCE END-DO Deleting Records

MODIFY Command MOVE 502 TO CUST-ID IN CUSTOMER FIND FOR UPDATE ANY CUSTOMER USING CUST-ID GET CUSTOMER IF DB-STATUS = 0 THEN MOVE “455 Cherry Lane, Hamilton, Ontario” TO ADDRESS IN CUSTOMER MODIFY CUSTOMER ELSE (perform error routine) END-IF Modifying Record Contents

STORE Command MOVE 503 TO CUST-ID IN CUSTOMER MOVE “James W. Smith” TO NAME IN CUSTOMER MOVE“201 Scenic Drive, Hamilton,Ontario” TO ADDRESS IN CUSTOMER MOVE TO ACCOUNT-BALANCE IN CUSTOMER STORE CUSTOMER Adding New Records

Set Operations CONNECT Command MOVE 231 TO INVNO IN INVOICE MOVE“7/7/99”TO DATE IN INVOICE MOVE TO INVOICE-AMOUNT IN INVOICE STORE INVOICE MOVE 431 TO CUST-ID IN CUSTOMER FIND ANY CUSTOMER USING CUST-ID CONNECT INVOICE TO CUSTOMER Placing a Record in a Set

DISCONNECT Command MOVE 254 TO INVNO OF INVOICE FIND ANY INVOICE USING INVNO DISCONNECT INVOICE FROM CUSTINV Removing a Record from a Set

RECONNECT Command MOVE 510 TO INVNO OF INVOICE FIND ANY INVOICE USING INVNO MOVE 431 TO CUST-ID IN CUSTOMER FIND ANY CUSTOMER USING CUST-ID RECONNECT INVOICE IN CUSTINV Changing Set Membership

Set Membership Classification Set insertion class Defined by the statement: INSERTION IS Manual insertion or Automatic insertion

Manual Insertion Mode Must be placed by using CONNECT –CONNECT TO SET NAME IS CUSTINV. OWNER IS CUSTOMER MEMBER IS INVOICE INSERTION IS MANUAL RETENTION IS OPTIONAL Subschema Fragment

MOVE 231 TO INVNO IN INVOICE MOVE“7/7/99”TO DATE IN INVOICE MOVE TO INVOICE-AMOUNT IN INVOICE STORE INVOICE MOVE 431 TO CUST-ID IN CUSTOMER FIND ANY CUSTOMER USING CUST-ID CONNECT INVOICE TO CUSTOMER Placing a Record in a Set

Automatic Insertion Mode Must be placed by using STORE –STORE MOVE 431 TO CUST-ID IN CUSTOMER FIND ANY CUSTOMER USING CUST-ID MOVE 231 TO INVNO IN INVOICE MOVE“7/7/99”TO DATE IN INVOICE MOVE TO INVOICE-AMOUNT IN INVOICE STORE INVOICE Placing a Record in a Set

Set Retention Retention options are: –Fixed –Mandatory –Optional

CUSTINV. OWNER IS CUSTOMER MEMBER IS INVOICE INSERTION IS MANUAL RETENTION IS OPTIONAL INVITEM OWNER IS INVOICE MEMBER IS LINE-ITEM INSERTION IS MANUAL RETENTION IS OPTIONAL Subschema Fragment

Implementation Large size Well-defined repetitive queries Well-defined transactions Well-defined applications