ISM 318: Database Systems Dr. Hamid R. Nemati Department of Information Systems Operations Management Bryan School of Business Economics Objectives Underst the basics of data databases Underst characteristics of a file system Underst advantages of using a database Underst characteristics of database systems Underst basic database concepts Underst three different types of database models Database A conceptual data model. It is used by the decision maker to recall the needed information. It specifies the entities about which the database contains data. It provides a description of the way in which these entities are related.
Data, information, knowledge Data Raw, unsummarized, unanalyzed facts Information Data processed into a meaningful form One person's information can be another's data Knowledge Knowing what information is required Knowing what the information means Hierarchy of Data Data Field Record File Raw facts that have little meaning unless they have been organized in some logical manner. The smallest piece of data that can be recognized by the computer is a single character, such as the letter A, the number 5, or some symbol such as;? > * +. A single character requires one byte of computer storage. A character or group of characters (alphabetic or numeric) that has a specific meaning. A field might define a telephone numbers, a birth date, a customer name, a year-to-date (YTD) sales value, so on. A logically connected set of one or more fields that describes a person, place, or thing. For example, the fields that comprise a record for a customer named J. D. Rudd might consist of J. D. Rudd s name, address, phone number, date of birth, credit limit, unpaid balance, so on. A collection of related records. For example, a file might contain data about ROBCOR Company s vendors; or, a file might contain the records for the students currently enrolled at Gigantic University. Hierarchy of Data Database Project database Database File Personal File Database File Department File Database File Payroll File Record 1 Record 2 Record 3 Field 1 Field 2
Database Managers File Processing Systems (FPS) Is used when working with a SINGLE database file Database Management Systems (DBMS) A collection of interrelated data a collection of programs that provide access to the data. The primary goal of a DBMS is to provide an environment which is both convenient efficient to use in retrieving information from storing information into the database. Contrasting Database File System Designs Functions of DBMS Storage Retrieval of data Processing data Generation of reports forms Issues to consider when dealing with DBMS Data Redundancy Data Inconsistency Data Dependency Data Integrity Data Security
Introducing the Database Importance of DBMS It helps make data management more efficient effective. Its query language allows quick answers to ad hoc queries. It provides end users better access to more better-managed data. It promotes an integrated view of organization s operations -- big picture. It reduces the probability of inconsistent data. The DBMS Manages the Interaction between the End User the Database File System Critique File System Data Management File systems require extensive programming in 3GL. As file systems become more complex, managing files gets more difficult. Making changes in existing file structures is important difficult. Data access programs are subject to change with file structure changes (structural dependence). Security features are difficult to implement are lacking.
File System Critique Structural 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 of all data access programs. Data dependence makes file systems extremely cumbersome from a programming data management point of view. File System Critique Field Definitions Naming Conventions A good (flexible) record definition anticipates reporting requirements by breaking up fields into their components. Example: Customer Name Last Name, First Name, Initial Customer Address Street Address, City, State Selecting proper field names is very important. Descriptive Self-documenting File System Critique Data Redundancy: Uncontrolled data redundancy sets the stage for Data Inconsistency (lack of data integrity) Data anomalies Modification anomalies Insertion anomalies Deletion anomalies
Database Systems In a database system, logically related data are stored in a single data repository. The database represents a change in the way end user data are stored, accessed, managed. DBMS makes it easier to eliminate most of the file system s data inconsistency, data anomalies, data structural dependency problems. Current DBMS stores not only the data structure, but also the relationships. DBMS takes care of defining all the required access paths. Database Systems Environment Database Systems The Database System Components Hardware Computer Peripherals Software Operating systems software DBMS software Applications programs utilities software
Database Systems The Database System Components People Systems administrators Database administrators Database designers Systems analysts programmers End users Procedures Instructions rules that govern the design use of the database system Data Collection of facts stored in the database Database Systems Database Systems Organizational Factors The complexity of database systems depends on various organizational factors: Organization s size Organization s function Organization s corporate culture Organizational activities environment Database solutions must be cost effective strategically effective. Database Systems Types of Database Systems Number of Users Single-user Multi-user Scope Desktop Workgroup Enterprise
Database Systems Types of Database Systems Location Centralized Distributed Use Transactional (Production) Decision support Data warehouse Database Systems DBMS Functions Data Dictionary Management Data dictionary stores definitions of the data elements their relationships (metadata). It provides data abstraction removes structural data dependency from the system. Data Storage Management DBMS creates data storage structure relieves us from the task of defining programming physical data characteristics. Database Systems DBMS Functions Data Transformation Management DBMS relieves us from the chore of making distinction between logical format physical format of data. Security Management DBMS provides user security data privacy within the database. Data security is especially important in multi-user database.
Database Systems DBMS Functions Multi-User Access Control DBMS ensures that multiple users can access the database concurrently still guarantees the integrity of the database. Backup Recovery Management DBMS provides backup recovery procedures to ensure data safety integrity. Data Integrity Management DBMS promotes enforces integrity rules to eliminate data integrity problems. Ensuring data integrity is especially important in transaction-oriented database systems. Introducing the Database Why Database Design Is Important? A poorly designed database is a breeding ground for uncontrolled data redundancies. A poorly designed database generates errors that lead to bad decisions. A Practical Approach to Database Design Focus on principles concepts of practical database design Use of two complete applications through the logical design stage A database model is a collection of logical constructs used to represent the data structure the data relationships found within the database. Two Categories of 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.
Three Types of Relationships in Conceptual One-to-many relationships Three Types of Relationships in Conceptual Many-to-many relationships Three Types of Relationships in Conceptual One-to-one relationships
Three Types of Implementation Database Models Hierarchical database model Network database model Relational database model Hierarchical Basic Structure Collection of records perceived as organized to conform to the upside-down tree structure. A tree structure is represented as a hierarchical path on the computer s storage media. One-to-Many (1:M) Relationship Each parent can have many children. Each child has only one parent. Hierarchical Data Structure Uses a Tree-like hierarchical structure. It links records of different types in a strict hierarchy form top to bottom. Each record, except those at the top, is associated with a specific parent. Each parent record can have several child records One-to-many relations Well suited for representing simple data structures
Hierarchical Structure for Database Hierarchical Advantages Data sharing security provision Data independence - Reduced programming maintenance effort Database integrity Efficiency dealing with a large database Large installed (mainframe) base, Abundant business applications Disadvantages Requirement of knowledge of physical level of data storage Inability to represent relationships that do not conform to the hierarchical 1:M stard Complex inflexible to manage Time consuming complicated application programming Lack of ad hoc query capability for end users Lack of stard concepts implementation -- limited portability Requirement of extensive programming activities Network Database Model Basic Structure Set -- A relationship is called a set. Each set is composed of at least two record types: an owner (parent) record a member (child) record. A Set
Network Data Structure Similar to Hierarchical structure, but provides more flexibility in the way different files are linked. It is permitted for a child record to have more than one parent record. It uses a Network structure. Many-to-many relations Most large scale mainframe DBMS in use today have a network structure. Network Database Model Relationships among the records are decomposed into a series of sets. Defining Set Components Network
Network Database Model Advantages Easier implementation of M:N relationships Superior data access type flexibility Enforced data integrity Sufficient data independence Disadvantages Difficult to design use properly Difficult to make changes in a database Very complex structure from the application programmer s point of view Complex navigational data access environment Relational Database Model Models Background E. F. Codd developed the relational model in 1970. Conceptually simple but versatile Major breakthrough for both users designers From stard transmission to automatic transmission Requires more computing power Considered impractical in the 1970 s Modern computers (even PCs) are powerful enough to hle relational databases. Relational Data Structure Consists of a collections of two dimensional tables, each of which is assigned a unique name. A row in a table represents a relationship among a set of values. Since a table is a collection of such records, there is a close correspondence between the concepts of tables mathematical concept of relations Relation is a two-dimensional table. Each row in the table holds data that pertains to some thing or a portion of some thing. Each column of the table contains data regarding an attribute
Relational Database Model Relational DataBase Management System (RDBMS) RDBMS allows user/designer operate in a human logical environment. Relational database is perceived by the user as a collection of tables in which data are stored. Each table consists of series of row/column intersections. Tables (or relations) are related to each other by sharing a common entity characteristic. The relationship type is often shown in a relational schema. A table yields complete data structural independence because it is a purely logical structure. Relational Database Model For a table to be a relation, it must meet certain restrictions: The cells of the table must be single valued Attributes must be of the same kind A column has a unique name The order of the columns in the table is insignificant No two rows (tuples) in a table may be identical The order of the rows is insignificant Relational Database Model
Relational Database Model Models Advantages Data independence structural independence Easy to design the database to manage its contents Less programming effort required Powerful flexible query capability: Structured Query Language (SQL) Fourth Generation Language (4GL) Specify what to do not how to do Introduced by IBM in 1974 3 parts: (1) User interface, (2) Set of tables (3) SQL engine Relational Database Model Disadvantages RDBMS requires substantial hardware operating system overhead. It tends to be slower than other database systems. Relational Data Model Relational Integrity Rules: Entity Integrity: No attribute which is primary key may have a null (nothing) value Referential Integrity: The values of foreign key must be either the values of the primary key of the reference table or be null.