1 Week 2 September 7 • File-based Systems and Database • Database Environment R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento What is Database? 2 • Definition: "A shared collection of logically related data, and a description of this data, designed to meet the information needs of the organization." • Data repository Management system controls access Customer transactions Payroll Vendors Inventory Operating expenses R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Traditional File-Based System 3 • Definition: "A collection of application programs that perform services for the end-users such as the production of reports. Each program defines and manages its own data." Customer transactions Operating expenses Inventory Vendors Payroll Program Program Program Program Program Report Report Report Report Report One file, one application R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento 4 For example… R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Invoice No. 0 0 0 1 O r d e r N o . 1 1 5 9 3 D a t e : 6 / / A c c o u n t N o . 5 S t e r e o s T o G o 1 0 0 5 2 5 9 4 1 2 i l l i a m T e l l C u s t o m e r :W A d d r e s s : 2 0 3 6 2 6 S t r e e t S a c r a m e n t o C A 9 5 8 1 9 C i t y S t a t eZ i p C o d e 1 8 9 3 D a t e S h i p p e d : 6 / / r o d u c t I t e m P C o d e N u m b e r P r o d u c t D e s c r i p t i o n / M a n u f a c t u r e r r i c e Q t y P S A G X 7 3 0 P i o n e e r R e m o t e A / V R e c e i v e r1 5 6 9 9 5 2A T 1 0 C e r v w i n V e g a L o u d s p e a k e r s 1 3 5 9 9 5 3C D P C 7 2 5 S o n y D i s c J o c k e y C D C h a n g e r1 3 9 9 9 5 1 4 5 R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Invoice Anatomy of an Invoice 6 Invoice No. Invoice Stereos To Go Date: / / Account No. Customer Customer: Address: City Invoice Date Shipped: Item Number State / Zip Code / Product Code Product Description/Manufacturer 1 Items purchased on the Invoice 2 3 4 5 Products and Manufacturers R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Qty Price Invoice Anatomy of an Invoice 7 Invoice No. Invoice Stereos To Go Date: / / 10001 051593 1005259412 William Account No. Customer Tell 2036 - 26 Street Customer: FD Invoice-File. 01 Invoice-Record. 05 Invoice-number Date Shipped: 05 / /Invoice-date 05 Cust-account-number 05 Cust-First-Name 05 Cust-Last-Name 05 Cust-Address • • • Products and Manufacturers Address: City Invoice Item Number Product Code 1 Items purchased on the Invoice 2 3 4 5 R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento State Zip Code Product Description/Manufacturer PIC X(5). PIC X(6). PIC X(10). PIC X(15). PIC X(20). PIC X(30). Qty Price ••• Traditional File-Based System Customer Orders Invoice Program 8 Invoices “A collection of application programs that perform services for the end users such as the production of reports. Each program defines and manages its own data.” Customer Accounts File Customer Account Program Account Report Customer Mailing List Customer Mailings Program Mailing List R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Data Redundancy • Customer Order File – Invoice number – Customer account number – Customer name, address, city, state, zip code – Order date – Product code, product description, price, unit • Customer Account File – Account Number – Customer name, mailing address, city, state, zip code • Customer Mailing List File – Customer name, mailing address, city, state, zip code R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento 9 File-Based Systems • Records contain logically related data • Limitations: – Separation and isolation of data (one file, one program) – Duplication of data • Loss of data integrity - uncertainty of the correct version of data and no consistency – Data dependence - application program defines the data – Incompatibility of file formats – Fixed queries/proliferation of application programs little flexibility in meeting changing information needs R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento 10 Database 11 • “A shared collection of logically related data (and a description of this data), designed to meet the information needs of an organization.” Data and Data Definitions Central Repository Separation R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Applications Data Abstraction 12 • Separation between the data’s structure (definition) and the application programs COBOL FD Master-File. 01 Master-Record. 05 ID 05 Customer-Fname . . . R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Tightly binds the data file and program PIC X(10). PIC X(25). Data Abstraction • Separation between the data’s structure (definition) and the application programs COBOL Tightly binds the data file and FD Master-File. program Data 01 Master-Record. Output 05 ID PIC X(10). Program 05 Customer-Fname PIC X(25). . . . R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento 13 Data Abstraction 14 • Separation between the data’s structure (definition) and the application programs Application programs can be run on either the clients or server Applications Data and Data Definitions DBMS Central Repository R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Organizing Data 15 • Entity - distinct object (i.e., person, place, thing, concept or event) • Attribute - describes some aspect of the entity (object) – Property of the entity • Relationship - association between entities Entity Entity Attributes Customers Account_number Name Address Relationship R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Purchases Invoice_number Account_number Purchase_date Stereos to Go Database 16 Management Queries Customer Orders Order Items DBMS Application Programs Products Manufacturers Central Repository (Organizational resource) • DDL • DML • Controlled access Single Access Point R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento Other Software Multitude of Applications Components of a Database Environment • • • • Hardware Software: DBMS, application program and query software Data: Organized in a schema, partitioned into subschemas Procedures: Govern the design, access and use of the database • People: Administrators (DA, DBA), designers (logical and physical), application developers and users (novice and high-powered) R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento 17 Advantages of the Database Approach • Control of data redundancy • Data consistency • Greater informational gain, more information from the same amount of data • Sharing data, organizational resource (i.e., shared resource) • Improved data integrity, validity and consistency • Improved access and security • Enforcement of standards R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento 18 Advantages of the Database Approach • Economy of scale, centralization and consolidation • Balancing of conflicting requirements, DBA oversees data and data definitions • Improved data accessibility and responsiveness • Increased productivity • Improved maintenance through data independence • Increased currency • Improved backup and recovery services R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento 19 Disadvantages of the Database Approach • • • • • • • • Complexity Dedication of resources including Size technology and people infrastructures Cost of DBMS Additional hardware costs Cost of conversion Performance Higher impact of failure In a production environment, processing can be slow R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento 20