Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 507 Database Programming Database Concepts DBMS Models.

Similar presentations


Presentation on theme: "CIS 507 Database Programming Database Concepts DBMS Models."— Presentation transcript:

1 CIS 507 Database Programming Database Concepts DBMS Models

2 2 Database A DATABASE is an organized collection of related data n McFadden-Hoffer – a shared collection of logically related data – designed to meet the information needs of multiple users in an organization n Kroenke – a self-describing collection of integrated records n self-describing: in addition to the user’s source data, contains a description of its own structure n collection of integrated records: user data, metadata (data about data), indexes to represent relationships among data and improve performance, data about applications that use the database n Rob-Coronel – a shared integrated computer structure that houses a collection of n end-user data--i.e. raw facts of interest to the end-user n metadata through which the data are integrated

3 3 File Management Systems The predecessor to the modern database management system Problems – Maintenance: Data created, managed, and accessed primarily through 3GL (COBOL, PL/I) – Data dependent: all components sensitive to changes made to data structure or storage and retrieval methods – Data Redundancy: uncontrolled duplication of data Data Inconsistency Data Anomalies – Sharing: inconsistent standards made it impossible to share data

4 4 DBMS A Database Management System (DBMS) is general purpose software and hardware facility to: – Create, delete, reorganize, and manipulate data in a database – Store, retrieve, share, and maintain data in a database – Maintain relationships between the database components – Provide security and procedures relating to privilege and access. – The integrity of all the updates and transactions that are carried out. – interface for the access, deletion and addition of data and for redefining the relationships within the database. A DBMS is a collection of programs that manages the database structure and controls access to the data stored in the database.

5 5 DBMS Disadvantages  DBMSs are complex;  Need for explicit backup and control;  Costs associated with development and operation can be substantial;  Consolidation of an entire business’ information resources can create a high level of vulnerability.

6 6 The Database System Environment n Hardware: computer, storage, networks, devices n Software: OS, DBMS, Applications, Untilities n People: – System Administrator – Database Administrator – Database Designers – Systems Analysts and Programmers – End-Users n Procedures n Data

7 7 Database Systems Types n Number of Users: – Single-user: usually desktop – Multi-user: workgroup (small); enterprise (large) n Location: – Centralized: all data stored in a database at a single site – Distributed: database is distributed across several sites n Type and Use: – Production (transactional): designed to support day-to-day use – Decision Support: designed to make tactical and strategic decisions at middle- and high-management levels – Decision Support Systems (data warehouse): use of historical data from many sources to make decisions such as pricing, sales forecasts, marketing positioning (e.g. structural estimates for insurance by underwriters)

8 8 DBMS Functions n Data Dictionary Management n Data Storage Management--Data Storage Definition Language (DSDL) n Data Transformation and Presentation n Database Control Language (DBCL) – Security Management – Multi-User Access Control n Backup and Recovery Management n Data Integrity Management n Data Access Languages – Data Definition Language (DDL) – Data Manipulation Language (DML) n Application Program Interfaces – COBOL, C, PASCAL, Visual Basic – Administrative Utilities n Data Communication Interfaces – queries, reports, email through web browsers

9 9 Features of a good DBMS n Open ended--can be extended n Flexible--can be changed n Efficient n Easy to use n Security should be built-in. n Data independence

10 10 Models n A database is a model of a user’s model of reality (Kroenke) n Many different types of models involved in databases ANSI/SPARC Conceptual Model External Model Internal Model Physical Model Reality Objects, Properties, Relationships Unique Identifier

11 11 ANSI/SPARC Architecture American National Standards Institute/Standards Planning and Requirements Committee External Model (end-user views) Conceptual Model (Database Administrator View) Physical Model (storage view) Internal Model (DBA view)

12 12 Conceptual Model n Global view of data n Enterprise-wide view as seen by DBA n Conceptual schema – basic blueprint for the database design – frequently represented with E-R diagrams n Hardware and software independent

13 13 External Model n Accessed by – Application programmer – End-user n External Schema – User’s authorized view of the data – A subset of the Conceptual Schema or a logical view of the Conceptual Schema n Hardware Independent; software dependent

14 14 Internal Model n Implementation of Conceptual Schema – Hierarchical Model DBMS – Network (CODASYL) Model DBMS – Relational Model DBMS – Object-Oriented Model DBMS – Semantic Model DBMS n Hardware independent; software dependent

15 15 Physical Model n Description of how data is to be stored – Definition of physical storage devices – Definition of physical access methods n Hardware and software dependent

16 16 Modeling Reality n Common Conceptual Modeling Terms: – Entity: a person, place, event, or thing for which data is to be collected – Attributes: properties or characteristics of an entity which describe the entity in the context of interest – Identifier: a means of distinguishing one entity from another – Entity Class: a collection of all entities of the same type, i.e. entities that have exactly the same properties – Relationship: an association among entities in the same or different classes n Internal Modeling Terms: unique to Internal (implementation) model – Hierarchical – Network (CODASYL) – Relational – OODBMS Semantic n Physical Model: strategy for storage and access is unique to the internal model

17 17 Relationships n One-to-Many – Advisor may have many Advisees – Advisee has but one Advisor (our choice) n Many-to-Many – Instructor may have many Students – Student may have many Instructors n One-to-One – Faculty is assigned to one office – An office is assigned to one faculty INSTRUCTORSTUDENT ADVISORADVISEE FACULTYOFFICE

18 18 Data Integrity Constraints Measures taken to ensure data is accurate n Business Constraints: rules that must be satisfied for the business – example: managers vacation days shall not exceed 20 n Entity Integrity Constraint: there is an attribute of the entity that is used to uniquely identify that entity – example: student id or ss# n Static Domain Constraint: a value for a property can only be one of the items in a predefined list – example: faculty may only be instructor, assistant professor, associate professor, professor n Referential Integrity Constraint: in a one-to-many association, an entity on the many side must be associated (reference) an entity on the one side – example: in an advising relationship, a student’s advisor must be a faculty member

19 19 Data Independence n Physical Data Independence: – Application programs and terminal activities remain logically unimpaired whenever any changes are made in either storage representation or access methods. n Logical Data Independence: – Application programs and terminal activities remain logically unimpaired when information preserving changes of any kind are made to the conceptual design

20 20 Hierarchical Model n EntitySegment n Entity ClassSegment type n Attributes: Fields n IdentifierValue-bearing field or disk address reference n Relationships – Internal Model--1-1 and 1-many in parent- child relationship; some support for two parents for same child – Physical Model--uses child/twin pointer strategy for 1-many n Data Access3GL products--COBOL, PL/I, C, Pascal n Commercial ProductsIMS (DL/I) and Focus

21 21 DBMS Models - Hierarchical STUDENT COURSE STUDENT -CLASS Conceptual Model Initial Data Collected

22 22 DBMS Models - Hierarchical STUDENT COURSE STUDENT -CLASS Conceptual Model STUDENT STUDENT- CLASS (Physical) COURSE STUDENT- CLASS (Logical) Physical Logical Modified Conceptual Model Parent-Child Associations

23 23 DBMS Models - Hierarchical Logical Modified Conceptual Model Parent-Child Associations STUDENT STUDENT- CLASS (Physical) COURSE STUDENT- CLASS (Logical) Physical Student DataTwin1 st ChildStudent-Class DataTwinCourse

24 24 DBMS Models - Hierarchical Course DataTwin1 st Child Ref to PhysicalTwin STUDENT STUDENT- CLASS (Physical) COURSE STUDENT- CLASS (Logical) Physical Logical Modified Conceptual Model Parent-Child Associations

25 25 DBMS Models - Hierarchical STUDENT STUDENT- CLASS (Physical) COURSE STUDENT- CLASS (Logical) Physical Logical Modified Conceptual Model Parent-Child Associations Student DataTwin1 st ChildStudent DataTwin1 st ChildStudent DataTwin1 st Child Student-Class DataTwinCourseStudent-Class DataTwinCourseStudent-Class DataTwinCourseStudent-Class DataTwinCourseStudent-Class DataTwinCourseStudent-Class DataTwinCourseStudent-Class DataTwinCourseStudent-Class DataTwinCourseStudent-Class DataTwinCourse

26 26 DBMS Models - Hierarchical STUDENT STUDENT- CLASS (Physical) COURSE STUDENT- CLASS (Logical) Physical Logical Modified Conceptual Model Parent-Child Associations Course DataTwin1 st Child Course DataTwin1 st Child Course DataTwin1 st Child Ref to PhysicalTwin Ref to Physical

27 27 Hierarchical Model n Advantages – Common database makes sharing practical – Security is provided and enforced – Supports some data independence – Referential integrity maintained through parent-child relationship – Very efficient for data models that are hierarchical (one-to-many) – Many hierarchical type applications are on mainframes

28 28 n Disadvantages – Knowledge of physical level required – Does not support logical data independence and does not support all physical data independence operations – Not all problems are one-to-many types – Problems with multiple parent implementation – Problems with anomalies for parent deletion – Application development in 3GL time-consuming – Support programs are not part of the DBMS – “System created by programmers for programmers!” Hierarchical Model

29 29 Network (CODASYL) Model n EntityRecord n Entity ClassRecord type n Attributes: Data items n IdentifierValue-bearing field or disk address reference n Relationships – Internal Model--1-1 and 1-many in owner-member set relationship; some provide elementary many-to-many relationships – Physical Model--same type records: doubly-linked, ringed structure n owners: additional references to first & last associated member in each set n members: additional references to associated owner in each set n Data Access3GL products--COBOL, PL/I, C, Pascal n Commercial ProductsDBMS-10, IDMS (Cullinet), IDS (Honeywell), TOTAL, IMAGE, MDBS-III

30 30 DBMS Models – Network (CODASYL) STUDENT COURSE STUDENT -CLASS Conceptual Model Initial Data Collected

31 31 STUDENT COURSE STUDENT -CLASS Conceptual Model Set Associations: Owner-Member DBMS Models – Network (CODASYL) STUDENT COURSE STUDENT -CLASS

32 32 Conceptual Model Set1: Owner (Student)  Member (Student-Class) STUDENT STUDENT-CLASS Student DataPrev1 st Mem Student-Class DataAssoc Owner DBMS Models – Network (CODASYL) NextLast Mem PrevNext

33 33 Course Data COURSE Conceptual Model Set2:Owner (Course)  Member (Student-Class) Associations DBMS Models – Network (CODASYL) STUDENT-CLASS Student-Class DataAssoc OwnerPrevNext Prev1 st MemNextLast Mem

34 34 Student DataNextFirst Mem DBMS Models – Network (CODASYL) STUDENT COURSE STUDENT -CLASS PrevLast Mem Student DataNextFirst MemPrevLast Mem Student-Class DataAssoc OwnerPrevNext Student-Class DataAssoc OwnerPrevNext Student-Class DataAssoc OwnerPrevNext Student DataNextFirst MemPrevLast Mem

35 35 Network Model n Advantages – Can be used to directly implement one-to-one, one-to- many, and (some DBMS models) many-to-many relationships – Access, navigation is superior to hierarchical model – Enforces referential integrity through owner-member relationship – Achieves some physical data independence

36 36 Network Model n Disadvantages – Difficult to design and use – Does not support logical data independence – Very complex--not for the novice – Navigation is achieved at the record level

37 37 Relational Model n EntityRow (Tuple) n Entity ClassTable (Relation) n Attributes: Column (?dimension?) n IdentifierValue-bearing field or generated value n Relationships – Internal Model--1-1 and 1-many relationships – Physical Model--uses foreign key to link parent to child n Data Access – 4GL-- SQL – 3GL products--COBOL, PL/I, C, Pascal n Commercial ProductsACCESS, ORACLE, DB2, SQL/DS, RBASE 500, INGRES, SYBASE

38 38 Relational Database Structure 0970000 Joe Bloe... 0970010 Julie King... 0970015 0970012 Anne Oether John Smith 0970035 John Smith... MIS1100 MIS1150 Information Systems Business Statistics... MIS1100... MIS1150... MIS1100 MIS1150 0970000 0970010 0970015 0970012 0970035... Unit Table Unit_Student Relationship Table Student Table Data relating to the relationship is stored in the relational table. Recording the semester of enrolment, marks, and the grade for each student along with the relationship places logically related data in one location.

39 39 Relational Model n Advantages n User can focus on only the logical view n Powerful query capabilities from 4GL—SQL n Ad hoc query capability n Aggregate processing as opposed to record at a time n Standardization of language n Creation, management, and data manipulation language n Easier to make changes to the logical design without affecting applications (Logical Data Independence)

40 40 Relational Model n Disadvantages n More powerful computers are needed because so much is done for the user n Ease of use creates a false sense of security in the area of design


Download ppt "CIS 507 Database Programming Database Concepts DBMS Models."

Similar presentations


Ads by Google