Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 5 Database Processing. Neil uses software to query a database, but it has about 25 standard queries that don’t give him all he needs. He imports.

Similar presentations


Presentation on theme: "Chapter 5 Database Processing. Neil uses software to query a database, but it has about 25 standard queries that don’t give him all he needs. He imports."— Presentation transcript:

1 Chapter 5 Database Processing

2 Neil uses software to query a database, but it has about 25 standard queries that don’t give him all he needs. He imports data from database into Excel where he moves, sorts, sums and averages data until he gets information he wants. It’s a pain, but it works. This Could Happen to You: “The Database Shows...” Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall FlexTime video clip 5-2

3 Q1What is the purpose of a database? Q2What does a database contain? Q3What is a DBMS, and what does it do? Q4What is a database application? Q5What is the difference between an enterprise DBMS and a personal DBMS? How does the knowledge in this chapter help FlexTime and you? Study Questions 5-3 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

4 Purpose: To organize and keep track of things Spreadsheets Keep track of only a single theme  Example: Student test scores in a course Databases Allow keeping track of multiple themes  Examples: Student grades, office visits, student email Q1: What Is the Purpose of a Database? 5-4 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

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

6 Student Data Shown in a Form from a Database 5-6 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

7 Q2: What Does a Database Contain? 5-7 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Table or file: A group of records

8 Hierarchy of Data Elements 5-8 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

9 Components of a Database 5-9 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall MetadataMetadata: Describes structure of database (tables, relationships, primary key, etc.) and its data such as data type (text, number, date), size, default, format, etc.

10 Relational database Database has multiple tables (one for each theme) Values in one table may relate to records in other tables Primary or Unique key Field(s) that uniquely identify a record in a table Each table must have a key Foreign key A non-primary key in one table that is related to a primary key of a different table Relationships Among Records 5-10 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

11 A column or group of columns that identifies a unique row in a table Student Number is key of Student table Every table must have a key Sometimes more than one column is needed to form a unique identifier Example: key of City table, would be a combination of City and State columns. Email_Num is key of Email Table VisitID is key of Office_Visit Table Key Special Terms 1-11 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

12 Relationships among tables are created by using foreign keys Relational databases Formal term for a table Relation More Special Terms 1-12 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

13 5-13 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Figure 5-6 Relationships Among Records in Three Tables

14 Database: Self-describing collection of integrated records Metadata Data that describes data Makes databases more useful Makes databases easier to use Describes data by: Data type: text, number, date, etc. Field name Field properties Metadata 5-14 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

15 Sample Metadata in Access 5-15 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

16 Database Management System (DBMS): DBMS ―Program that creates, processes, and administers databases ―Examples: DB2, Microsoft Access, SQL Server, Oracle, MySQL (open-source DBMS) Q3: What Is a DBMS and What Does It Do? 5-16 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Database Collection of tables, relationships, and metadata Database Collection of tables, relationships, and metadata

17 Components of a Database Application System 5-17 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

18 Creating the Database and Its Structure: Adding “Response?” Field to a Table 5-18 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

19 Read, Insert, Modify, and Delete data Four DBMS operations International standard language for processing databases Structured Query Language (SQL) INSERT INTO Student ([Student Number], [Student Name], HW1, HW2, MidTerm) VALUES (1000, ‘Franklin, Benjamin’, 90, 95, 100) Example SQL statement Processing the Database: SQL 5-19 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Assignment: View this in your Access assignment as you create a query

20 DBMS security features to set up user accounts, passwords, permissions, processing limits PermissionsPermissions—setting data access rights for specific users or groups of users. We typically do not do it in Access database, but in network database like SQL Server Database backupDatabase backup and replication, adding structures, removing unneeded data Administering the Database 5-20 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

21 Q4: What Is a Database Application? 5-21 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

22 Forms Reports Queries Used to read, insert, modify, and delete data Show data in structured context May compute values such as Totals, within a report Are a means of getting answers from database data Forms, Reports, and Queries 5-22 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

23 Example of a Database Query and Query Result 5-23 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Query form Query result Report

24 Processing logic for a specific business need Internet database processing to: Connect web server and database Respond to events Read, insert, modify, delete data Database Application Programs 5-24 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

25 Four Database Application Programs Running on a Web Server Via Internet 5-25 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

26 Lost-update problem Occurs when two or more transactions select same record at same time, then update it based on values first received. Each transaction is independent. Last update overwrites updates previously made by others. Multiuser Processing Considerations 5-26 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 10-5 = 510-3 = 7 5, 7 or 3?

27 1.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: Lost-update problem Lost-update problemLost-update problem 1-27 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

28 Locking Prevents another user or process to change a record currently being used by another user or process. Gets only a Read-only copyGets only a Read-only copy. Preventing Lost Update Problem 5-28 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

29 Enterprise DBMS Enterprise DBMS Processes large organizational and workgroup databases Supports many users (thousands plus) Examples: DB2, SQL Server, Oracle, MySQL Enterprise DBMS Enterprise DBMS Processes large organizational and workgroup databases Supports many users (thousands plus) Examples: DB2, SQL Server, Oracle, MySQL Personal DBMS Personal DBMS Designed for smaller, simpler database applications Supports fewer than 100 users (mostly 1–10 users) Examples: Access, dBase, FoxPro, R-Base Personal DBMS Personal DBMS Designed for smaller, simpler database applications Supports fewer than 100 users (mostly 1–10 users) Examples: Access, dBase, FoxPro, R-Base Q5: What Is the Difference Between an Enterprise DBMS and a Personal DBMS? 5-29 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

30 Personal Database System 5-30 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall

31 Personal Assignment 5-31 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall Create a Microsoft Access database that will contain three to four tables such as: CustomerCustomer ProductsProducts OrdersOrders BillingBilling Create a Form through which Customers can make ordersCreate a Form through which Customers can make orders Create a Query and then a Report of recent Orders by CustomersCreate a Query and then a Report of recent Orders by Customers


Download ppt "Chapter 5 Database Processing. Neil uses software to query a database, but it has about 25 standard queries that don’t give him all he needs. He imports."

Similar presentations


Ads by Google