Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 5 Database Processing.

Similar presentations


Presentation on theme: "Chapter 5 Database Processing."— Presentation transcript:

1 Chapter 5 Database Processing

2 GearUp: “YOU Don’t Know Anything About Report Writing”
GearUp needs operating data to analyze for cost-cutting decisions Need to extract and combine data from multiple systems Will use Access to create reports GOALS Illustrate how databases can be used to facilitate decision making. Show creativity and innovation in processing data to obtain desired results. Show the value of information when avoiding mistakes. GearUp managers need data on cancelled customer orders resulting from a supplier canceling a shipment or making a partial shipment. Data will be extracted from multiple, isolated systems and combined and imported to Access so reports can be created. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

3 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall
Study Questions Q1: What is the purpose of a database? Q2: What is a database? Q3: What are the components of a database application system? Q4: How do database applications make databases more useful? Q5: How are data models used for database development? Q6: How is a data model transformed into a database design? Q7: What is the users’ role in the development of databases? Q8: 2023? This chapter discusses why, what, and how of database processing. It begins by describing purpose of databases and explaining important components of database systems. Next, it gives an overview of creating a database system and your role as a future user. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

4 Q1: What Is the Purpose of a Database?
Organize and keep track of things Keep track of multiple themes General rule: Single theme store in a spreadsheet Multiple themes require a database Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

5 A List of Student Grades, Presented in a Spreadsheet
Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

6 Student Data Shown in a Form, from a Database
With a database, a professor can record student grades, s, and office visits all in one place. Forms are difficult, if not impossible, to produce from a spreadsheet, but easily produced with a database. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

7 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall
Q2: What Is a Database? A database is a self-describing collection of integrated records. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

8 Components of a Database
Formal term for table is “relation”. Linking relations together creates relationships. A database is a group of related tables. Metadata is a dictionary, of sorts, that describes tables, fields, and relationships. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

9 What Are Relationships Among Rows?
First row of the Table is related to Andrea Baker in Student Table. Last row in Office_Visit Table related to Adam Verberra in Student Table. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

10 Sample Metadata (in Access)
Access example of metadata for the table. It is metadata that makes a database self-describing. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

11 Ethics Guide: Nobody Said I Shouldn’t
Chris made copy of backup database, took it home Queried sysTables to find table and field names Found data on orders, customers, salespeople Discovered peculiar sales discounts Mentioned it to Jason (sales clerk) Chris fired next business day GOALS Illustrate the utility of metadata and SQL, even for non-authorized purposes. Discuss the ethics of unauthorized data access. Consider the need for organizational data policies. As a future business manager or owner, what does the ease with which this can be done tell you? What is a reasonable policy for an organization to have regarding employees taking data home? Chris most likely uncovered a kickback scheme involving Jason. Jason’s boss might be involved also, which is why Chris was fired. Chris has two options: (1) He could report what he found to higher-level management, or (2) talk to a lawyer about getting whistleblower protection, or pursuing legal action. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

12 Q3: What Are the Components of a Database Application System?
DBMS is software used to create applications, process data, provide access and manage database. Popular DBMSs: DB2, Microsoft Access, SQL Server, Oracle, MySQL. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

13 Adding a New Column to a Table (in Access)
First DBMS function: Provide a means for creating a database application Here, developer creates table. User specifies filed names and declares various properties for each field, such as data type, format, caption default value, validation rule, etc. Tables can be easily changed by adding new fields. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

14 Processing the Database
Four DBMS operations Read Insert Modify Delete Second DBMS function: Process the database Such processing can be quite complex. DBMS performs operations to read, insert, modify, or delete data. These operations are requested by applications. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

15 Structured Query Language (SQL)
SQL (see-quell) International standard Used by most popular DBMS SQL statement: INSERT INTO Student ([Student Number], [Student Name], HW1, HW2, MidTerm) VALUES (1000, ’Franklin, Benjamin’, 90, 95, 100); Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

16 Summary of Database Administration Tasks
Third DBMS function: Provide tools to assist in database administration This involves a wide variety of activities. DBMS can be used to set up a security system involving user accounts, passwords, permissions, limits for processing the database, and provide database security. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

17 Using MIS InClass 5: How Much Is a Database Worth?
Data has resale value Data on everything customers do Use to target customer for offerings they care about, avoid those they don’t Costly and difficult to replace data collected over many years The Firm’s database contains data on everything customers do. It’s their most important asset. The Firm’s customers make about 15,000 visits a year, an average of 500 visits per day. It keeps data on every customer and every visit. Data could be sold to others. It has competitive value because it can be used to improve services and facilities, identify trends, etc. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

18 Q4: How Do Database Applications Make Databases More Useful?
GearUp buyers use first application to schedule events. Operations personnel use Event Setup application to setup the graphics, auction terms and screens. Accounting personnel use Event Accounting application to process event financial results. These applications have different purposes, features, and functions, but they all use Event Database. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

19 What Are Forms, Reports, and Queries?
Example of Student Report Report structure creates information because it shows student data in meaningful context. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

20 Sample Query Form Used to Enter Phrase for Search and Result
Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

21 Why Are Database Application Programs Needed?
Process logic specific for a business need Enable processing via Internet Four Application Programs on a Web Server Computer Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

22 Multi-User Processing Problem
Process A reads customer record from file containing customer’s account balance. 1 Process B reads same record from same file, now has its own copy. 2 Process A updates account balance in its copy of customer record and writes record to file. 3 Process B has original stale value for account balance. Updates customer’s phone number and writes customer record to file. 4 Process B writes stale account balance value to file, causing changes made by Process A to be lost. 5 Lost-update problem is a characteristics of multi-user database processing. To prevent this problem, some type of locking must be used to coordinate the record-update activities of multiple users. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

23 Enterprise DBMS vs. Personal DBMS
Enterprise DBMS process large organizational and workgroup databases for 100s/1000s of users Personal DBMS designed for smaller databases used by 1 to 100 users. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

24 Q5: How Are Data Models Used for Database Development?
Database Development Process Database development process starts with interviewing users to identify database requirements. Requirements are summarized in a data model. Validated data model is transformed into a database design, which is implemented into database structures. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

25 What Is the Entity-Relationship (E-R) Data Model?
Tool for constructing data models Describes contents of data model by defining entities and relationships among entities Unified Modeling Language (UML), less popular, tool for data modeling E-R models are a popular tool for constructing data models. Developers use it to describe content of a data model by defining the things (entities) to be stored in database and relationships among those entities. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

26 Student Data Model Entities
Entities are rectangles. Name of entity above rectangle, and key is shown at the top of the entity. Unlike Student or Adviser, does not have a record key. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

27 Example of Department, Adviser, and Student Entities and Relationships
Diagrams like this one are too cumbersome for use in database design discussions. Instead, database designers use diagrams called entity-relationship (E-R) diagrams. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

28 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall
Sample E-R Diagrams Version 1 Crow’s Feet 1:N N:M Left side of top figure shows a one-to-many (1:N) relationship between department and advisers. On right is a many-to-many (N:M) relationship between adviser and students. Crow’s feet indicate whether relationship is 1:N or N:M. Version 2 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

29 Crow’s-Foot Diagram Version
Minimum and Maximum Cardinality Crow’s feet also indicate maximum cardinality with a vertical bar on connecting line. Vertical bar means that at least one entity of that type is required. Symbol for minimum cardinality is a small oval. Oval indicates optional relationship. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

30 Q6: How Is a Data Model Transformed into a Database Design?
Poorly structured Employee table Database design is process of converting a data model into tables, relationships and data constraints. Database design team transforms entities into tables and expresses relationships by defining foreign keys. Design also involves two important database design concepts: (1) normalization and (2) the representation of two kinds of relationships. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

31 Normalizing for Data Integrity
Two normalized tables Normalizing tables eliminates data duplication, but can slow processing times. Goal of normalization is to construct tables so every table has a single topic or theme. To do that, a table is split into two tables with each table having a single theme. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

32 Summary of Normalization
Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

33 Steps for Transforming Data Model Into a Database Design
Construct Adviser table and Student tables with key fields Represent relationships by adding foreign keys Create new table for N:M relationships Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

34 Transforming a Data Model into a Database Design: 1:N Relationship
Step 1: Represent entities with tables and identifier keys Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

35 Representing an N:M Relationship
N:M relationships require creating a new table, Advisor_Student_Intersection. Step 2: Represent relationships by adding foreign keys Step 3: Create new tables to represent N:M relationship Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

36 Q7: What Is the Users’ Role in the Development of Databases?
Define what data database must contain User review of data model is crucial Does model accurately reflect your view of the business? Final approval of data models Devote time to do it right Users are final judges of what data the database should contain and how tables should be related. Users review data models to ensure they accurately reflect users’ views of the business. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

37 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall
Q8: 2023? Volume of database data to grow exponentially Relational databases will look much different Use of non-relational data stores, called NoSQL will be more common Major DBMS vendors lose out to open-source products and shift focus to services supporting open source software like Bigtable, Dynamo, Cassandra? Database models will be very different With ever cheaper data storage and data communications, databases will become much bigger and more attractive targets for theft or mischief. Database world will look much different. Use of large non-relational data stores, called NoSQL, on servers in cloud will increase. Will Microsoft and Oracle and other DBMS vendors lose market to open-source products and become sellers of services supporting open source software like Cassandra? Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

38 Guide: No, Thanks, I’ll Use a Spreadsheet
Databases take time to build Complicated to operate Need IS people to create and keep them running Salesman doesn’t want to share data Spreadsheets sometimes better option, especially if data needs are simple GOALS Understand one user’s experience in development of a database application. Explore security requirements for a shared database. Understand one way that users respond to technology challenges. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

39 Guide: Immanuel Kant, Data Modeler
Perception of reality is based on our perceptive apparatus. Brain processes perceptions into something meaningful. Human’s model what appears to be. Users must determine if a data model fits their perception of reality. GOALS Understand why the statement, “My data model is a better model of reality than your data model” is nonsense—and arrogant! Realize a data model is a model of users’ mental models, not a model of reality. Stimulate students’ curiosity about the philosophical foundations of information systems. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

40 Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall
Active Review Q1: What is the purpose of a database? Q2: What is a database? Q3: What are the components of a database application system? Q4: How do database applications make databases more useful? Q5: How are data models used for database development? Q6: How is a data model transformed into a database design? Q7: What is the users’ role in the development of databases? Q8: 2023? Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

41 Case Study 5: Fail Away with Dynamo, Bigtable, and Cassandra
Current relational DBMS products not designed for large, multi-server systems NoSQL databases – Dynamo, Bigtable, Cassandra Amazon: Dynamo Google: Bigtable processes petabytes of data on hundreds of thousands of servers Both created to be elastic Cassandra used by Facebook, Twitter, Digg, Reddit Goal Illustrate complexity of Amazon’s Dynamo database server system, Google’s Bigtable and Facebook’s Cassandra. Stress the competitive importance of a company’s database system. Illustrate Moore’s Law at work. Copyright © 2014 Pearson Education, Inc. Publishing as Prentice Hall

42


Download ppt "Chapter 5 Database Processing."

Similar presentations


Ads by Google