Download presentation
1
Chapter 5 Database Processing
2
WHAT IS THE PURPOSE OF A DATABASE?
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
3
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 Basic purpose of a database is to organize and keep track of things. Databases are needed when you need to keep track of multiple themes, such as grades, students, office visits and messages. General rule: Use a spreadsheet for lists of data involving single theme. Use a database for data with multiple themes.
4
A List of Student Grades Presented in a Spreadsheet – Single Theme
Spreadsheet with a single theme – Grades.
5
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
Data Redundancy and Data Inconsistency Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
6
Student Data Form With Multiple Themes
Forms are difficult, if not impossible, to produce from a spreadsheet, but are easily produced with a database.
7
WHY DO WE NEED DATABASES
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
8
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
Why we need databases Size Ease of Updating Accuracy Security Redundancy Importance Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
9
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
WHAT IS A DATABASE? Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
10
Components of a Database
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
11
Tables Table or file: A group of records
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
12
Tables (cont’d) Each table must have a unique identifier called the Primary Key (PK) Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
13
Relational databases Relation More Special Terms
Relationships among tables are created by using foreign keys Relation Formal term for a table Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
14
Relationships Among Records
Database has multiple tables (one for each theme) Values in one table may relate to records in other tables Field(s) that uniquely identify a record in a table Relational database Primary or Unique key Foreign key Each table must have a key A non-primary key in one table that is related to a primary key of a different table Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
15
Primary and Foreign Keys
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
16
Metadata Metadata Describes data by:
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 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
17
Sample Metadata in Access
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
18
Features of Relational Databases
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
19
Features of Relational Databases (cont’d)
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
20
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
WHAT IS A DBMS? Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
21
What Is a DBMS and What Does It Do?
Database management system (DBMS) Program that creates, processes, and administers databases Examples: Database Collection of tables, relationships, and metadata DBMS A software program Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
22
Components of a Database Application System
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
23
Processing the Database
Four DBMS operations Read Insert Modify Delete data These operations are requested in applications that call upon the DBMS in different ways.
24
Structured Query Language (SQL)
SQL (see-quell) International standard Used by most popular DBMS Structured Query Language (SQL) is used for processing the database. SQL is an international standard language for creating databases and database structures, and processing databases. SQL is used by all popular DBMS products.
25
Structured Query Language (SQL)
Structured Query Language (SQL) is used for processing the database. SQL is an international standard language for creating databases and database structures, and processing databases. SQL is used by all popular DBMS products.
26
WHAT IS A DATABASE APPLICATION?
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
27
Database Applications
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
28
Forms, Reports, and 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 Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
29
How Are Database Application Systems Developed?
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
30
How Are Database Application Systems Developed?
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
31
What Are the Components of the Entity-Relationship Data (ERD) Model?
Something users want to track Order, customer, salesperson, item, volunteer, donation Entities Describe characteristics of an entity OrderNumber, CustomerNumber, VolunteerName, PhoneNumber Attributes Attribute that uniquely identifies one entity instance from other instances Student_ID_Number Identifier Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
32
Creating ERDs Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
33
Student Data Model Entities
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
34
Example of Department, Adviser, and Student Entities and Relationships
A department may have many advisers An adviser works in one department An adviser advises many students A student may have one or more advisers 1:N relationships N:M relationships Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
35
Example of Department, Adviser, and Student Entities and Relationships
N:M 1:N Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
36
Entity Relationship Diagram (ERD) ― Version 1
Crow’s Feet 1:N N:M 1:N = one-to-many relationships One department can have many advisers, but an adviser is in only one department N:M = many-to-many relationships One adviser can have many students and one student can have many advisers Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
37
Entity Relationship Diagram (ERD) – Version 2
“Crow’s Foot” N:M = many-to-many relationship A department has many advisors and an advisor may advise for more than one department 1:N = one-to-many relationship A student has only one advisor, but an adviser may advise many students Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
38
Defining one-to-many relationships
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
39
How Are Database Application Systems Developed?
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
40
Transforming a Data Model into a Database Design
Represent each entity with a table Entity identifier becomes table key Entity attributes become table columns Normalize tables as necessary Represent relationships Use foreign keys Create additional tables for N:M relationships Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
41
Representing 1:N Relationships
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
42
Exploring many-to-many relationships
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
43
Representing an N:M Relationship: Strategy for Foreign Keys
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
44
How Are Database Application Systems Developed?
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
45
What Is the Difference Between an Enterprise DBMS and a Personal DBMS?
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
46
What Is the Difference Between an Enterprise DBMS and a Personal DBMS?
Processes large organizational and workgroup databases Supports many users (thousands plus) Examples: DB2, SQL Server, Oracle, MySQL Personal DBMS Designed for smaller, simpler database applications Supports fewer than 100 users (mostly 1–10 users) Examples: Access, dBase, FoxPro, R-Base Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.