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?. Adminis
Trang 1Database Processing
Chapter 5
Trang 2“No, Drew, You Don’t Know Anything About
Creating Queries."
• Sales 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 creates queries and reports.
• 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: 2025?
Trang 4Q1: What Is the Purpose of a Database?
• Organize and keep track of things
• Keep track of multiple themes
• General rule:
Trang 5A List of Student Grades Presented in a
Spreadsheet – Single Theme
Trang 6Student Data Form from a Database
Trang 7Q2: What Is a Database?
Trang 8Hierarchy of Data Elements
Trang 9Components of a Database
Trang 10Example of
Relationships
Among Rows
Trang 11Sample Metadata (in Access 2003)
Trang 12Ethics Guide: Querying Inequality?
• MaryAnn has a data mart.
• Business professional majored in HR, now "expert"
in SQL
• Uses SQL to do her job faster and better
• What are your personal, professional, social responsibilities?
Trang 13Ethics Guide: Querying Inequality? (cont’d)
• 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?
Trang 14So What? Not What the Data Says
• Perception based on small sample
can’t get any prospects to bite.”
• Fact: “Not what the data says."
• Key skill - isolating facts from our perceptions.
facts
Trang 15Q3: What Is a Database Management System
Trang 16Processing the Database
Trang 17Processing 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);
Trang 18Adding a New Column to a Table (in Access 2013)
Trang 19Administering the Database
• Set up security system involving user accounts, passwords, permissions, and limits for processing
• Limit user permissions in very specific ways
• Backing up database data, adding structures to improve performance of database applications, removing unwanted data
Trang 20Summary of Database Administration Tasks
Trang 21Summary of Database Administration Tasks
(cont'd)
Trang 22Q4: How Do Database Applications Make
Databases More Useful?
Forms View data; insert new, update existing, and
delete existing data.
Queries Search based upon data values provided by the user.
Reports Structured presentation of data using sorting, grouping, Filtering, and other operations.
Application programs Provide security, data consistency, and special purpose processing, e.g., handle
out-of-stock situations.
Trang 23Q4: How Do Database Applications Make
Databases More Useful? (cont'd)
Trang 24Example of a Student Report
Trang 25Query Example
Trang 26Browser Forms, Reports, Queries, and
Applications
Trang 27Account Creation Browser Form
Trang 28Browser
Report
Trang 29Dynamic Content Report: Clicked to Produce
Other Reports or Take Other Actions
Trang 301 Andrea reads pedal
record showing
balance of 2 pedals
1
2 Jeffrey reads same record showing balance
of 2 pedals
2
3 Andrea puts both in shopping baskets, but delays checking out
3
4 Jeffrey puts both in shopping basket and checks out before Andrea
4
5 Andrea proceeds to checkout Someone will be disappointed.
5
Multi-User Processing Problem
Trang 31Q5: How Are Data Models Used for Database
Development?
Trang 32• Something users want to track
• Order, customer, salesperson, item, volunteer, donation
Entities
• Describe characteristics of an entity
• OrderNumber, CustomerNumber, VolunteerName, PhoneNumber
Trang 33Student Data Model Entities
Trang 34Example of Department, Adviser, and Student
Entities and Relationships (cont'd)
Trang 35Sample of Relationships―Version 1
Crow’s Feet
N:M
An Adviser may have many students, and one student may have many advisers
1:N One department may have many advisers, but an adviser may be in
Trang 36Sample of Relationships─Version 2
1:N
A student has only one advisor, but an adviser
N:M
A department has many
advisors, and an advisor may advise for
“Crow’s Foot”
Trang 37Crow’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
required
Minimum cardinality—minimum number of entities in a
relationship Small oval means entity is optional; relationship
Trang 38Q6: How Is a Data Model Transformed into a
Database Design?
• Normalization
more well-structured tables
Trang 39Data Integrity Problems
• Data integrity problems
• Can only occur if data are duplicated
Trang 40Poorly Designed Employee Table Causes Data
Integrity Problem
Trang 41Two Normalized Tables
Single
Themes
Trang 42Summary of Normalization
Trang 43Representing 1:N Relationships
Trang 44Representing an N:M Relationship: Strategy for
Foreign Keys
Trang 45Q7: What Is the Users’ Role in the Development of
Databases?
• Users are the final judges
• Users review of data model is crucial
business
employees need to do your jobs, and relationships must accurately reflect your view of the business
Trang 47Q8: 2025? (cont'd)
• More reliance on open source community
• Many NoSQL databases
• New opportunities and career paths develop around NoSQL databases
Trang 48Q8: 2025? (cont'd)
NoSQL DBMS (Not Relational DBMS)
– Supports very high transaction rates – Relatively simple data structures
– Replicated on many servers in the cloud
• Examples
– Dynamo (Amazon) – Bigtable (Google)
Trang 49Q8: 2025? (cont'd)
• Will NoSQL Replace Relational DBMS Products?
background in computer science
specialized applications
Trang 50Security Guide: Theft by SQL Injection
• One common way of stealing data from corporations
• Done by people outside of host nation to avoid prosecution
• Many of these groups are highly organized and well-funded
One of China’s Cyber Espionage Units”
• Attempting SQL injection on a Web site could result in your
Trang 51Security Guide:
Theft by SQL
Injection (cont'd)
Trang 52Guide: Immanuel Kant, Data Modeler
• Perception of reality based on our perceptive apparatus
• Brain processes perceptions into something meaningful
• Human’s model what appears to be
• Users determine if a data model fits their perception of reality
Trang 53Active 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: 2025?
Trang 54Case Study 5: Searching for Pianos
• Certified piano tuner and technician repairing and restoring pianos for many years
• Clown entertainer at children’s parties
Trang 55Pianos in Storage
Trang 56Columns in
the Piano
Table
Trang 57Query Design and Result
Trang 58Piano Sound
Quality by Building