1 Chapter 1 File Systems and Databases Database

1 Chapter 1 File Systems and Databases Database Systems: Design, Implementation, and Management, 4 th Edition Peter Rob & Carlos Coronel 1

Introducing the Database v Major 1 ü Database Concepts Data and information l Data - Raw facts l Information - Processed data ü Data management ü Database ü Metadata ü Database management system (DBMS) 2

Sales per Employee for Each of ROBCOR’S Two Divisions 1 Figure 1. 1 3

Introducing the Database v 1 Importance of DBMS ü It helps make data management more efficient and effective. ü Its query language allows quick answers to ad hoc queries. ü It provides end users better access to more and bettermanaged data. ü It promotes an integrated view of organization’s operations -- “big picture. ” ü It reduces the probability of inconsistent data. 4

The DBMS Manages the Interaction Between the End User and the Database 1 Figure 1. 2 5

Introducing the Database v Why Database Design Is Important? 1 ü A well-designed database facilitates data management and becomes a valuable information generator. ü A poorly designed database is a breeding ground for uncontrolled data redundancies. ü A poorly designed database generates errors that lead to bad decisions. 6

Historical Roots v Why Study File Systems? 1 ü It provides historical perspective. ü It teaches lessons to avoid pitfalls of data management. ü Its simple characteristics facilitate understanding of the design complexity of a database. ü It provides useful knowledge for converting a file system to a database system. 7

Contents of the CUSTOMER File 1 Figure 1. 3 8

Table 1. 1 Basic File Terminology 1 9

Contents of the AGENT File 1 Figure 1. 4 10

A Simple File System 1 Figure 1. 5 11

File System Critique v File System Data Management 1 ü File systems require extensive programming in a thirdgeneration language (3 GL). ü As the number of files expands, system administration becomes difficult. ü Making changes in existing file structures is important and difficult. ü Security features to safeguard data are difficult to program and usually omitted. ü Difficulty to pool data creates islands of information. 12

File System Critique v 1 Structural and Data Dependence ü Structural Dependence A change in any file’s structure requires the modification of all programs using that file. ü Data Dependence A change in any file’s data characteristics requires changes in all data access programs. Significance of data dependence is the difference between the data logical format and the data physical format. ü Data dependence makes file systems extremely cumbersome from a programming and data management point of view. ü 13

File System Critique v 1 Field Definitions and Naming Conventions ü A good (flexible) record definition anticipates reporting requirements by breaking up fields into their components. l Example: – Customer Name Last Name, First Name, Initial – Customer Address Street Address, City, State 14

File System Critique v 1 Field Definitions and Naming Conventions ü Selecting proper field names is very important. l Names must be as descriptive as possible within restrictions. l Naming must reflect designer’s documentation needs and user’s reporting and processing requirements. 15

File System Critique v 1 Data Redundancy: Uncontrolled data redundancy sets the stage for ü Data Inconsistency (lack of data integrity) ü Data anomalies l Modification anomalies l Insertion anomalies l Deletion anomalies 16

Figure 1. 6 1 17

The Database System Environment 1 Figure 1. 7 18

Database Systems v 1 The Database System Components ü Hardware l l ü Computer Peripherals Software l l l Operating systems software DBMS software Applications programs and utilities software 19

Database Systems v 1 The Database System Components ü People l l l ü Procedures l ü Systems administrators Database administrators (DBAs) Database designers Systems analysts and programmers End users Instructions and rules that govern the design and use of the database system Data l Collection of facts stored in the database 20

Database Systems v 1 The Database System Components ü ü The complexity of database systems depends on various organizational factors: l Organization’s size l Organization’s function l Organization’s corporate culture l Organizational activities and environment Database solutions must be cost effective AND strategically effective. 21

Database Systems v 1 Types of Database Systems ü Number of Users l Single-user – Desktop database l Multiuser – Workgroup database – Enterprise database ü Scope l l l Desktop Workgroup Enterprise 22

Database Systems v Types of Database Systems 1 ü Location l l ü Centralized Distributed Use l l l Transactional (Production) Decision support Data warehouse 23

Database Systems v DBMS Functions 1 1. Data Dictionary Management 2. Data Storage Management 3. Data Transformation and Presentation 4. Security Management 5. Multi-User Access Control 6. Backup and Recovery Management 7. Data Integrity Management 8. Database Access Languages (DDL and DML) and Application Programming Interfaces 9. Database Communication Interfaces 24

Database Models 1 v A database model is a collection of logical constructs used to represent the data structure and the data relationships found within the database. v Two Categories of Database Models ü Conceptual models focus on the logical nature of the data representation. They are concerned with what is represented rather than how it is represented. ü Implementation models place the emphasis on how the data are represented in the database or on how the data structures are implemented. 25

Database Models v Three Types of Relationships 1 ü One-to-many relationships (1: M) l A painter paints many different paintings, but each one of them is painted by only that painter. – PAINTER (1) paints PAINTING (M) ü Many-to-many relationships (M: N) l An employee might learn many job skills, and each job skill might be learned by many employees. – EMPLOYEE (M) learns SKILL (N) ü One-to-one relationships (1: 1) l Each store is managed by a single employee and each store manager (employee) only manages a single store. – EMPLOYEE (1) manages STORE (1) 26

Database Models v Three Types of Implementation Database Models 1 ü Hierarchical database model ü Network database model ü Relational database model 27

A Hierarchical Structure 1 Figure 1. 8 28

Database Models v 1 Hierarchical Database Model ü Basic Structure l Collection of records logically organized to conform to the upside-down tree (hierarchical) structure. l The top layer is perceived as the parent of the segment directly beneath it. l The segments below other segments are the children of the segment above them. l A tree structure is represented as a hierarchical path on the computer’s storage media. 29

Database Models v Hierarchical Database Model ü 1 Advantages l l l ü Conceptual simplicity Database security Data independence Database integrity Efficiency dealing with a large database Disadvantages l l l Complex implementation Difficult to manage Lacks structural independence Applications programming and use complexity Implementation limitations Lack of standards 30

Child with Multiple Parents 1 Figure 1. 9 31

Database Models v Network Database Model 1 ü Basic Structure l Set -- A relationship is called a set. Each set is composed of at least two record types: an owner (parent) record and a member (child) record. l A set is represents a 1: M relationship between the owner and the member. 32

A Network Database Model 1 Figure 1. 10 33

Database Models v Network Database Model 1 ü ü Advantages l Conceptual simplicity l Handles more relationship types l Data access flexibility l Promotes database integrity l Data independence l Conformance to standards Disadvantages l System complexity l Lack of structural independence 34

Database Models v Relational Database Model ü 1 Basic Structure l RDBMS allows operations in a human logical environment. l The relational database is perceived as a collection of tables. l Each table consists of a series of row/column intersections. l Tables (or relations) are related to each other by sharing a common entity characteristic. l The relationship type is often shown in a relational schema. l A table yields complete data and structural independence. 35

Linking Relational Tables 1 Figure 1. 11 36

Database Models v Relational Database Model 1 ü Advantages l l l ü Structural independence Improved conceptual simplicity Easier database design, implementation, management, and use Ad hoc query capability (SQL) Powerful database management system Disadvantages l l l Substantial hardware and system software overhead Possibility of poor design and implementation Potential “islands of information” problems 37

A Relational Schema 1 Figure 1. 12 38

Database Models v Entity-Relationship Data Model 1 ü It is one of the most widely accepted graphical data modeling tools. ü It graphically represents data as entities and their relationships in a database structure. ü It complements the relational data model concepts. 39

Database Models v Entity Relationship Data Model ü 1 Basic Structure l l E-R models are normally represented in an entity relationship diagram (ERD). An entity is represented by a rectangle. Each entity is described by a set of attributes. An attribute describes a particular characteristics of the entity. A relationship is represented by a diamond connected to the related entities. 40

Figure 1. 13 Relationship Depiction: The ERD 1 41

Figure 1. 14 Relationship Depiction: The Crow’s Foot 1 42

Database Models v Entity-Relationship Data Model 1 ü ü Advantages l Exceptional conceptual simplicity l Visual representation l Effective communication tool l Integrated with the relational database model Disadvantages l Limited constraint representation l Limited relationship representation l No data manipulation language l Loss of information content 43

Database Models v Object-Oriented Database Model 1 ü Characteristics l An object is described by its factual content. l An object includes information about relationships between the facts within the object, as well as with other objects. l An object is a self-contained building block for autonomous structures. 44

Database Models v Object-Oriented Database Model 1 ü Basic Structure l Objects are abstractions of real-world entities or events. l Attributes describe the properties of an object. l Objects that share similar characteristics are grouped in classes. l A class is a collection of similar objects with shared structure (attributes) and behavior (methods). l Classes are organized in a class hierarchy. l An object can inherit the attributes and methods of the classes above it. 45

A Comparison: The OO Data Model and the ER Model 1 Figure 1. 15 46

Database Models v Object-Oriented Database Model 1 ü ü Advantages l Add semantic content l Visual presentation includes semantic content l Database integrity l Both structural and data independence Disadvantages l Lack of OODM standards l Complex navigational data access l Steep learning curve l High system overhead slows transactions 47

The Development of Data Models 1 Figure 1. 16 48

Wrap-Up: The Evolution of Data Models 1 v Common characteristics required for data models: ü A data model must show some degree of conceptual simplicity without compromising the semantic completeness. ü A data model must represent the real world as closely as possible. ü The representation of the real-world transformations (behavior) must be in compliance with the consistency and integrity characteristics of any data model. 49

Wrap-Up: The Evolution of Data Models 1 v Database Models and the Internet The use of the Internet as a prime business tool is shifting focus to database products that interface efficiently and easily with the Internet. ü Successful “Internet age” databases are characterized by: l l l Flexible, efficient, and secure Internet access. Support for complex data types and relationships. Seamless interfacing with multiple data sources and structures. Simplicity of the conceptual database model. An abundance of available database tools. A powerful DBMS to help make the DBA’s job easier. 50
- Slides: 50