Process A reads customer record from file containing customer’s account balance.. Process B reads same record from same file now has its own copy.. Process A updates account balance in
Trang 1Database Processing
Chapter 5
Trang 2“No, Drew, You Don’t Know Anything About Creating Queries."
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
• AllRoad Parts operational database used to determine which parts to consider for 3D printing
• If Addison and Drew depend on Lucas (or IT dept) to produce reports, they will (a) wait a long time and (b) probably not
get what they want.
• Once they get data, Addison create queries and reports without help from Lucas
• Relying on own skills gives more freedom and better results.
• Relational database technology not appropriate for 3D parts files or graphics used for query-by-graphics MongoDB a
better choice.
Trang 3Study Questions
Q1: What is the purpose of a database?
Q2: What is a database?
Q3: What is a database management 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: 2024?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 4Q1: What Is the Purpose of a Database?
• Keep track of multiple themes
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 5A List of Student Grades Presented in a Spreadsheet – Single Theme
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 6Student Data Form With Multiple Themes
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 7Q2: What Is a Database?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 8Hierarchy of Data Elements
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 9Components of a Database
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 115-11 Sample Metadata (in Access)
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 12Ethics Guide: Querying Inequality?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 13Ethics Guide: Querying Inequality? (cont’d)
• You can query databases to learn all sorts of patterns and trends.
– Be sure what answers you want before starting query.
• How strongly do you feel about social and personal responsibility, considering your needs and those of your
family?
• How important is social responsibility posture of an employer to you? Is that something you want to add to your
criteria for finding a job?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 14Q3: What Is a Database Management System (DBMS)?
• DB2 from IBM, Access and SQL Server from Microsoft, Oracle Database from Oracle Corporation.
• MySQL - open source, license-free for most applications.
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 16Processing the Database
• Structured Query Language - SQL (see-quell)
INSERT INTO Student
([Student Number], [Student Name], HW1, HW2, MidTerm)
VALUES (1000, ‘Franklin, Benjamin’, 90, 95, 100)
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 17Administering the Database
processing.
unwanted data.
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 18Summary of Database Administration Tasks
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 19Summary of Database Administration Tasks (cont'd)
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 20Elements of Database Applications
Forms View data;, insert new, update existing, and delete existing data
Reports Structured presentation of data using sorting, grouping, filtering, and other operations
Queries Search based upon data values provided by the user
Application Programs Provide security, data consistency, and special purpose processing, e.g., handle out-of-stock
situations
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 21Using MIS InClass 5: How Much Is a Database Worth?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 22Q4: How Do Database Applications Make Databases
More Useful?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 23Example of a Student Report
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 24Query Example
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 25Browser Forms, Reports, Queries, and Applications
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 26Account Creation Browser Form
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 27Browser
Report
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 281 Process A reads customer record
from file containing customer’s
account balance
1
2 Process B reads same record from same file now has its own copy
2
3 Process A updates account balance in its copy of customer record and writes record to file
3
4 Process B has original stale value for
account balance Updates customer’s phone number and writes customer record to file
4
5 Process B writes stale account balance value to file, causing changes made by Process A to be lost
5
Multi-User Processing Problem
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 29Q5: How Are Data Models Used for Database
Development?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 30• Something users want to track
• Order, customer, salesperson, item, volunteer, donation
Entities
• Describe characteristics of an entity
• OrderNumber, CustomerNumber, VolunteerName, PhoneNumber
Trang 31Student Data Model Entities
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 32Example of Department, Adviser, and Student Entities and Relationships (cont'd)
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 33an adviser may be in only one department
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 34“Crow’s Foot”
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 35Crow’s-Foot Diagram Version
Maximum cardinality─maximum number of entities involved in a relationship Vertical bar on a line means that at least one entity is required
Minimum cardinality—minimum number of entities in a relationship Small oval means entity is optional;
relationship need not have an entity of that type.
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 37Data Integrity Problems
information, and the system gets a poor reputation.
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 38Poorly Designed Employee Table Causes Data Integrity Problem
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 39Two Normalized Tables
Single Themes
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 40Summary of Normalization
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 41Representing 1:N Relationships
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 42Representing an N:M Relationship: Strategy for Foreign Keys
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 43Q7: What Is the Users’ Role in the Development of Databases?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 44Q8: 2024?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 45Q8: 2024? (cont'd)
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 46Q8: 2024? (cont'd)
NoSQL DBMS (Not Relational DBMS)
Supports very high transaction rates.
Relatively simple data structures.
Replicated on many servers in the cloud.
Trang 47Q8: 2024? (cont'd)
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 48Guide: No, Thanks, I’ll Use a Spreadsheet
Construct a data model and have users validate it.
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 49Guide: No, Thanks, I’ll Use a Spreadsheet (cont'd)
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 50Guide: Immanuel Kant, Data Modeler
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 51Active Review
Q1: What is the purpose of a database?
Q2: What is a database?
Q3: What is a database management 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: 2024?
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 52Case Study 5: Fail Away with Dynamo, Bigtable, and Cassandra
C o p y r i g h t © 2 0 1 5 P e a r s o n E d u c a t i o n , I n c
Trang 535-53