Database Management Systems Edited by: Dr. El-Masry

Slides:



Advertisements
Similar presentations
Relational Database and Data Modeling
Advertisements

Chapter 12 File Processing and Data Management Concepts
Database Management3-1 L3 Database Management Santa R. Susarapu Ph.D. Student Virginia Commonwealth University.
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
Introduction to Databases
Database Management Systems
Accounting System Design
Relational Databases Chapter 4.
Introduction to Database Management  Department of Computer Science Northern Illinois University January 2001.
File Systems and Databases
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Database Management: Getting Data Together Chapter 14.
Organizing Data & Information
The Relational Database Model:
Introduction to Databases Transparencies
File Systems and Databases Hachim Haddouti
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Chapter 3: Data Modeling
System Analysis and Design
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Database Management Systems
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly.
Chapter One Overview of Database Objectives: -Introduction -DBMS architecture -Definitions -Data models -DB lifecycle.
PHASE 3: SYSTEMS DESIGN Chapter 7 Data Design.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Chapter 4 The Relational Model.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
Introduction to Accounting Information Systems
Chapter 1 Overview of Database Concepts Oracle 10g: SQL
Database Technical Session By: Prof. Adarsh Patel.
STORING ORGANIZATIONAL INFORMATION— DATABASES CIS 429—Chapter 7.
© 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Database Management Systems Accounting Information Systems, 5 th edition James A. Hall COPYRIGHT © 2007 Thomson South-Western, a part of The Thomson Corporation.
1 Chapter 9 Database Management Systems. 2 Objectives for Chapter 9 zProblems in the flat-file approach to data management yWhy these gave rise to the.
Concepts and Terminology Introduction to Database.
Lecture 2 An Overview of Relational Database IST 318 – DB Admin.
I Information Systems Technology Ross Malaga 4 "Part I Understanding Information Systems Technology" Copyright © 2005 Prentice Hall, Inc. 4-1 DATABASE.
©2003 Prentice Hall Business Publishing, Accounting Information Systems, 9/e, Romney/Steinbart 4-1 Accounting Information Systems 9 th Edition Marshall.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network.
Chapter 1 Introduction to Databases © Pearson Education Limited 1995, 2005.
Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
1 Chapter 1 Introduction to Databases Transparencies.
Advanced Accounting Information Systems Day 10 answers Organizing and Manipulating Data September 16, 2009.
Management Information Systems, 4 th Edition 1 Chapter 8 Data and Knowledge Management.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
Hall, Accounting Information Systems, 7e ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly.
©2003 Prentice Hall Business Publishing, Accounting Information Systems, 9/e, Romney/Steinbart 4-1 Relational Databases.
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Chapter 9 Designing Databases 9.1.
©2003 Prentice Hall Business Publishing, Accounting Information Systems, 9/e, Romney/Steinbart 4-1 Relational Databases.
Chapter 3: Relational Databases
Data Resource Management Data Concepts Database Management Types of Databases Chapter 5 McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies,
Database Management Systems
Database Management.
Chapter 4 Relational Databases
Chapter 2 Database Environment.
Accounting System Design
Accounting System Design
Accounting Information Systems 9th Edition
Database Design Chapter 7.
Presentation transcript:

Database Management Systems Edited by: Dr. El-Masry Chapters IV, XV, and XVI Database Management Systems Edited by: Dr. El-Masry 1

What’s the Difference Between a Database and a Spreadsheet??

Flat-File Environment Data User 1 Transactions Program 1 A,B,C User 2 Transactions Program 2 X,B,Y User 3 Transactions Users access data via computer programs that process the data and present information to the users. Users own their data files. Data redundancy results as multiple applications maintain the same data elements. Files and data elements used in more than one application must be duplicated, which results in data redundancy. As a result of redundancy, the characteristics of data elements and their values are likely to be inconsistent. Outputs usually consist of preprogrammed reports instead of ad-hoc queries provided upon request. This results in inaccessibility of data. Changes to current file-oriented applications cannot be made easily, nor can new developments be quickly realized, which results in inflexibility. Program 3 L,B,M 3

Data Redundancy & Flat-File Problems (Advantages of DataBase Systems) Data Storage - creates excessive storage costs of paper documents and/or magnetic form Data Updating - any changes or additions must be performed multiple times Currency of Information - potential problem of failing to update all affected files Task-Data Dependency - user’s inability to obtain additional information as his or her needs change 4

Database Approach (Figure 4-2) User 1 Transactions Program 1 A, B, C, X, Y, L, M D B M S User 2 Transactions Program 2 User 3 Transactions Solves the following problems of the flat file approach no data redundancy - except for primary keys, data is only stored once single update current values task-data independence - users have access to the full domain of data available to the firm A database is a set of computer files that minimizes data redundancy and is accessed by one or more application programs for data processing. The database approach to data storage applies whenever a database is established to serve two or more applications, organizational units, or types of users. A database management system (DBMS) is a computer program that enables users to create, modify, and utilize database information efficiently. Program 3 6

Elements of the Database Approach Administrator System Development Process System Requests Applications User Programs DBMS Transactions Data Definition Language Host Operating System U S E R Transactions User Programs Data Manipulation Language Transactions User Programs Query Language Physical Database User Queries 8

4 Elements of the DB Approach Users Database Administrator (DBA) DBMS—software that runs the DB Physical database

Users Access DB in two ways: User programs Queries (SQL)

DBA Personal responsible for maintaining the DB: 1- Responsible for maintaining the data dictionary Ex: What is meant by “customer” Complete description of entities and their attributes in the DB 2- Responsible for the backup and recovery of the database 3- Responsible for the logical security of the database (establishing an effective password system).

Physical Database The lowest level of the DB The magnetic spots on the hard drive

DBMS Features User Programs - make the presence of the DBMS transparent to the user Direct Query - allows authorized users to access data without programming Application Development - user created applications Backup and Recovery - copies database Database Usage Reporting - captures statistics on database usage (who, when, etc.) Database Access - authorizes access to sections of the database 10

Internal Controls and DBMS The purpose of the DBMS is to provide controlled access to the database. The DBMS is a special software system programmed to know which data elements each user is authorized to access and deny unauthorized requests of data. 7

Data Definition Language (DDL) DDL is a programming language used to define the database to the DBMS (Pg. 111). The DDL identifies the names and the relationship of all data elements, records, and files that constitute the database. Viewing Levels (abstract): internal view - physical arrangement of records (1) conceptual view - representation of database (1) (ERD is conceptual view) (schema) user view - the portion of the database each user views (many) (subschema) Refer to the SQL DDL handout. 11

Data Manipulation Language (DML) DML is the proprietary programming language that a particular DBMS uses to insert, update, process, store, and delete data (Pg. 111). Entire user programs may be written in the DML, or selected DML commands can be inserted into universal programs, such as COBOL and FORTRAN. Refer to the SQL DML handout. 12

Data Query Language (DQL) The query capability permits end users and professional programmers to access data in the database without the need for conventional programs (Pg. 111). IBM’s Structured Query Language (SQL) is a fourth-generation language that has emerged as the standard query language. Refer to the SQL DQL handout. 13

Steps in Designing a Database Phase I: Prepare the conceptual model (ERD) (Pgs. 554-556) Identify the entities Identify the relationships between the entities Prepare the ER diagram (ERD) Phase II: Specify the logical design (relational schema) Form the tables and relationships (associations) between tables Show the links between the primary keys and foreign keys. Phase III: Normalize the tables Final tables in third normal form should be free of anomalies. Phase IV: Implement the physical design Develop the physical structures Populate the tables Query the tables Access Lab. in weeks 8 and 9.

Prepare the Conceptual Model Phase 1 Prepare the Conceptual Model Draw an ERD to capture the process. 1

ER-Diagram Symbols Relationship Attribute Entity Primary Key

An Entity ...is an ...may be a specific individual object concept event ...may be a specific tangible object intangible object Entity Class is a collection of entities with similar attributes. individual object: a person, place or a thing Tangible object: particular employee, product, computer, or customer intangible concept or event such as a particular bank account, cost center, part failure event, airline flight, or the sale of goods to a customer. Entity Class: customers, students, and patients. Number of entities for an organization depends on the size and complexity of an organization

Attributes A property of an entity that we choose to record (of interest to an organization). CUSTOMER (entity) PRODUCT (entity) customer # product # name description address finish telephone no. price balance qty. on hand In this example, Customers and Products represent entities and the items below represent attributes of those entities. Each entity in an entity class must have at least one attribute (or several in combination) that distinguishes it from other entities in that class. Example: Social security number is an identifier for an employee and a product number for a product. Sometimes, the identifier will be a combination of two or more attributes -- for example, invoice number and product number.

(Maximum cardinalities method) (Pg. 566) Entity Relationship Entity 1 1 Sales- person Car Assigned 1 M Customer Places Order M M Vendor Supplies Inventory 23

Example of a Relationship Linking Two Entities 1 M CUSTOMER ORDER places Order Number Item # Name Number

ERD Exercises Hospital ERD Exercise (handout) University ERD Exercise (handout)

Relational Model Data Linkages (>1 table) No explicit pointers are present. The data are viewed as a collection of independent tables. Relations are formed by an attribute that is common to both tables in the relation. Assignment of foreign keys: if 1 to many association, the primary key on the one side is embedded as the foreign key on the many side. if many to many association, create a new relation with the primary keys of the two entities as its primary key if 1 to 1 association, either of the tables’ primary keys may be the foreign key and is embedded in the other table Remark: Mandatory versus optional entities distinction: If there is a mandatory/optional relationship, then primary on the mandatory side becomes foreign on the optional side. 33

ER-Diagram using REA Model Sales Inventory Line items 1 Party to Sales person M M 1 Pays for Made to Customer 1 M Received from M Cash Collections 1 M Cash Increases Cashier M 1 Received by 34

Specify the Logical Design (Relational schema) Phase 2 Specify the Logical Design (Relational schema) Create a list with all the relational tables and connect them. 1

Logical Data Structures A particular method used to organize records in a database is called the database’s structure. The objective is to develop this structure efficiently so that system developers can build the database in less time. Also, data can be accessed quickly and easily using the schema. Types of structures include for example: hierarchical (AKA the tree structure) Relational (the one used in this class) Important Rule: In a relational schema, arrows linking the primary key and the foreign key will always point from foreign key to primary key. Example: Pg. 597 Relational Schema Exercises: Hospital schema exercise (handout) University schema exercise (handout)

The Relational Model The relational model portrays data in the form of two dimensional tables: relation - the database table attributes (data elements) - form columns tuples (records) - form rows data - the intersection of rows and columns 31

Properly Designed Relational Tables No repeating values - All occurrences at the intersection of a row and column are a single value. The attribute values in any column must all be of the same class. Each column in a given table must be uniquely named. Each row in the table must be unique in at least one attribute, which is the primary key. 32

Phase 3 Normalize the tables Transform unnormalized tables into tables in 3rd normal form .

Why Do We Normalize? (Three Types of Anomalies Pgs. 114-116) Insertion Anomaly: A new item cannot be added to the table until at least one entity uses a particular attribute item. Deletion Anomaly: If an attribute item used by only one entity is deleted, all information about that attribute item is lost. Update Anomaly: A modification on an attribute must be made in each of the rows in which the attribute appears. Anomalies can be corrected by creating relational tables. 79

Advantages of Relational Tables Removes all three anomalies Various items of interest (customers, inventory, sales) are stored in separate tables. Space is used efficiently. Very flexible. Users can form ad hoc relationships. 38

The Normalization Process A process which systematically splits unnormalized complex tables into smaller tables that meet two conditions: all nonkey (secondary) attributes in the table are dependent on the primary key all nonkey attributes are independent of the other nonkey attributes When unnormalized tables are split and reduced to third normal form, they must then be linked together by foreign keys. Refer to handout on normalization Normalization handout exercises 38

Steps in Normalization Table with repeating groups Remove repeating groups First normal form 1NF Remove partial dependencies Second normal form 2NF Remove transitive dependencies Third normal form 3NF Remove remaining anomalies Higher normal forms 86

Auditors/Accountants and Data Normalization The update anomaly can generate conflicting and obsolete database values. The insertion anomaly can result in unrecorded transactions and incomplete audit trails. The deletion anomaly can cause the loss of accounting records and the destruction of audit trails. Auditors and accountants should have an understanding of the data normalization process and be able to determine whether a database is properly normalized. 40

Implement the Physical Design Phase 4 Implement the Physical Design Implement in Access (or other DB program) 1

Physical Database Design Transition from theoretical to physical aspects of database IS  IT Develop the physical structures Decisions about software and hardware Implementation Establish internal controls Populate the database with data Produce physical user views (multiple) Query the database Access Lab. in weeks 8 and 9. 18