Download presentation
Presentation is loading. Please wait.
1
Copyright © 2015 Pearson Education, Inc.
Chapter 4 Database Processing Copyright © 2015 Pearson Education, Inc.
2
Copyright © 2015 Pearson Education, Inc.
Learning Objectives Q1. What is the purpose of a database? Q2. What are the contents of a database? Q3. What are the components of a database application system? Q4. How do data models facilitate database design? In this chapter, we’ll address several learning objectives. We’ll identify the purpose of a database as well as the contents of a database. We’ll also see and discuss the various components of a database application system and how data models facilitate database design. Copyright © 2015 Pearson Education, Inc.
3
Copyright © 2015 Pearson Education, Inc.
Learning Objectives Q5. How is a data model transformed into a database design? Q6. Why are NoSQL and Big Data important? Q7. How can the intramural league improve its database? Continuing in this chapter, we’ll discuss how data models are transformed into database design. The users also play a role in the development of databases and we’ll see that relationship. We’ll introduce ourselves to NoSQL and Big Data. Finally, we’ll look at a practical example of databases and how they can improve operations by reviewing the intramural league described in your textbook. Copyright © 2015 Pearson Education, Inc.
4
What Is the Purpose of a Database?
Databases keep track of things Lists of data and themes Single theme (concept) Can be managed using a spreadsheet Multiple themes (concepts) Require databases So the question we first address is the question surrounding the purpose of a database. Quite simply, we use databases to keep track of things. We can use lists to store data and sometimes the lists can be well maintained using simple spreadsheets. This is appropriate if the list is simple, meaning it has a single theme or concept. In such cases, the user of this data really only needs to capture the data for a single purpose. Should the user wish to use the list for other purposes that require additional data, it’s then said to have multiple themes. In such cases, a spreadsheet is not appropriate and a database is then required. On the next slide, let’s take a look at the differences. Copyright © 2015 Pearson Education, Inc.
5
What Is the Purpose of a Database?
In the examples in this slide, we see the differences between data in a spreadsheet and data in a database. In Figure 4-1, we can maintain data, such as grades in a spreadsheet. The use of a spreadsheet for this form of a list is appropriate because it has a single theme: grades. However, should the user want to keep additional records as we see in Figure 4-2, like or office visits, it then takes on multiple themes. For these cases, a database is required for maintaining and recording that data. Copyright © 2015 Pearson Education, Inc.
6
What Are the Contents of a Database?
Self-describing collection of integrated records Characters (bytes) Columns (fields) Rows (records) Tables (files) A database is defined as a self-describing collection of integrated records. To fully understand databases, we need to familiarize ourselves with the contents of a database. First, we learned in the previous chapter that bytes are characters. As we can see in this diagram, there are several characters or bytes in this database table. Notice the use of the term, “table.” A table is considered a file that contains similar rows or records. A database contains many tables. The columns in this table are call fields. They describe the information in each row or record. To put this in context, let’s look at this diagram. Each row is a record for a student. The records that are stored in this table are described by the columns or fields. For instance, the student number describes each student record, as does the student name. This collection of student records is called a table. Copyright © 2015 Pearson Education, Inc.
7
What Are the Contents of a Database?
What are the relationships among rows? Key A value in one row of one table that appears as a value in another row of another table Primary key A value that identifies a unique row in a table Foreign key A value in one table that appears as a primary key in another table to which it relates As we previously mentioned, a database consists of many tables. These tables are linked together by relationships among rows. The relationships are created using keys. A key is a value in one row of a table that appears as a value in a row of another table. There are two basic keys: primary keys and foreign keys. A primary key is a value that identifies a unique row in a table, whereas a foreign key is a value in one table that appears as a primary key in another table. Let’s look at an example of how this works in the next slide. Copyright © 2015 Pearson Education, Inc.
8
What Are the Contents of a Database?
Relational Database In this slide, we see relationships indicated by lines that connect the tables. These lines are identifying values in rows of one table that appear as values in rows of another table. This is what we referred to a short while ago as keys. Let’s start by looking at the Student Table in the middle. The student number is the value in the rows that uniquely identifies the row. No two students will have the same number, whereas it’s possible they could have the same name or grade. Thus, the Student Number is a primary key. Additionally, we see the Student Number appears as values in rows of both the Table and the Office Visit table. In those two tables, the value for Student Number is considered a foreign key, because it serves as the primary key in the Student Table. This concept of linking tables together using foreign keys is called a relational database. Copyright © 2015 Pearson Education, Inc.
9
What Are the Contents of a Database?
Metadata Data that describe data Recall the definition of a database as a self-describing collection of integrated records. This means the database itself contains information about the data. Data that is used to describe data is called metadata. Copyright © 2015 Pearson Education, Inc.
10
What Are the Components of a Database Application System?
DBMS Application(s) Database Application Systems are made up of three major components. They are the database (which we discussed earlier), a database management system (DBMS), and one or more database applications. We’ll talk more now about database management systems, then discuss database applications. Copyright © 2015 Pearson Education, Inc.
11
What Are the Components of a Database Application System?
Database Management Systems (DBMS) Creating the database and its structures Processing the Database Read, insert, modify, or delete data Structured Query Language (SQL) Administering the database Database Administrator (DBA) Earlier, we talked about database tables and their relationships. A DBMS is responsible for creating these tables and defining the relationships. This is the first function of a DBMS shown above. In addition to creating the database and its structures, a DBMS is also used to process the database. A DBMS has four basic processing operations. They are read data, insert data, modify data, or delete data in a database. Structured Query Language (SQL) is an international standard language used to process the database. Finally, a DBMS is used to administer the database. There are several administration tasks which we’ll look at in the next slide, but it’s important to note that organizations generally assign a role to one or more individuals to serve as database administrators, or DBA’s. Copyright © 2015 Pearson Education, Inc.
12
What Are the Components of a Database Application System?
Database Management Systems (DBMS) In this table, we see a host of administration tasks accomplished by the DBMS. As you can see, many of the specific tasks can be broken down into categories, like development, operation, backup and recovery, and adaptation. As mentioned in the previous slide, these tasks are generally the responsibility of the DBA. Copyright © 2015 Pearson Education, Inc.
13
What Are the Components of a Database Application System?
Collection of: Forms Reports Queries Application programs Databases alone aren’t very useful. We use database applications to convert the data into meaningful information. One of the applications is a form. Forms are used primarily for data entry to read, insert, modify, and delete data. Reports are used to show data in a structured form. They are especially useful for analytical purposes. Queries are used to help locate data in the database. Application programs are unique because, while the other three are standard functions, we need application programs to process logic specific to a given business need. It is also possible to process databases over the Internet. In such cases, the application program serves as a link between the DBMS and a Web server. Copyright © 2015 Pearson Education, Inc.
14
What Are the Components of a Database Application System?
Multi-user Processing Lost update problem This slide demonstrates the concept of how processing can take place over the Internet, but it also shows something else: multi-user processing. A potential problem exists in multi-user environments. The problem is called the lost update problem. Lost update problems occur when more than one user is processing the database and a conflict occurs. To prevent this problem, multi-user processing requires some form of lock logic. Lock logic will prevent more than one user from processing the same thing in the database and needs to be accounted for in these situations. Copyright © 2015 Pearson Education, Inc.
15
What Are the Components of a Database Application System?
Enterprise DBMS versus Personal DBMS Enterprise DBMS 1000’s of users Personal DBMS Less than 100 users DBMS products fall into two broad categories, as shown in this slide. As you can see, enterprise DBMS are for large organizations with hundreds and thousands of users. Personal DBMS are for fewer users (generally less than 100). Today, MS Access is the only remaining personal DBMS. Copyright © 2015 Pearson Education, Inc.
16
What Are the Components of a Database Application System?
DBMS Database Application(s) To review the components of database application systems, we saw that there are three main components. The first is the database, which alone are not very useful. Second, we discussed database management systems and their uses. Finally, we addressed database applications. Copyright © 2015 Pearson Education, Inc.
17
How Do Data Models Facilitate Database Design?
Database Design Process To get an understanding of how data models facilitate database design, we need to get an understanding of the database design process. The design process begins with collecting user requirements on what data the users will need to do their jobs. Before the developers can begin the design, they create data models, which are a logical representation of the database. These models include the data and relationships to be stored in the database. We often refer to these data models as Entity Relationship (E-R) data models. Finally, these data models are used to create the database design. Copyright © 2015 Pearson Education, Inc.
18
How Do Data Models Facilitate Database Design?
Entity Relationship (E-R) Model Tool for constructing data models Entities Something users want to track Attributes Relationships Entities are linked to each other Data models involve entity relationship models, entities, and relationships. To understand these data models, we need to learn some of the terms associated with them. The first is the relationship model, which if the tool used for constructing data models. Unified Modeling Language (UML) is also a tool for this, but is less popular. Entities are defined as something users want to track. An example of an entity is customers. Attributes are used to describe entities. An attribute for a customer could be the customer’s address. A special form of an attribute is called an identifier. The identifier uniquely describes an entity. A unique identifier for a customer might be the customer number. Finally, entities are linked to one another in what are described as relationships. In the next slide, we’ll take a look at these relationships. Copyright © 2015 Pearson Education, Inc.
19
How Do Data Models Facilitate Database Design?
Entity Relationship (E-R) Diagrams Maximum Cardinality The diagrams in this slide are two versions of entity relationship diagrams, also referred to as E-R diagrams. The diagrams depict relationships between entities. You’ll also notice something called, crow’s feet in these examples. These crow’s feet indicate something called maximum cardinality. That is, the crow’s feet show the maximum number of entities that can be involved in the relationship. On the next slide, we’ll see a third example of an E-R diagram, depicting minimal cardinality. Copyright © 2015 Pearson Education, Inc.
20
How Do Data Models Facilitate Database Design?
Entity Relationship (E-R) Diagrams Maximum and Minimum Cardinality In this example, we see both maximum and minimum cardinality. The vertical line represents minimal cardinality, meaning at least one entity of that type is required. The small oval means the entity is optional and the relationship does not require an entity of that type. As an example, an adviser must belong to a single department, but a department does not need to have an advisor relationship. Copyright © 2015 Pearson Education, Inc.
21
How Is a Data Model Transformed into a Database Design?
Normalization Converting poorly structured tables into two or more well-structured tables Next we have to consider how data models are transformed into a database design. To do this, we’ll need to understand what normalization means. Normalization is the converting of poorly structured tables into two or more well-structured tables. Copyright © 2015 Pearson Education, Inc.
22
How Is a Data Model Transformed into a Database Design?
Normalization Data integrity problems Normalizing for data integrity Part of the challenge with normalization is dealing with data integrity problems. Data integrity problems occur when a table has inconsistent data. This needs to be resolved. To do this, we perform normalization for data integrity. One of the reasons for data integrity problems is due to duplicate data. To normalize a table with duplicate data, we simply get rid of the duplicate data by transforming the table into two tables. This ensures we have tables with a single theme, which is one of the goals of normalization. Copyright © 2015 Pearson Education, Inc.
23
How Is a Data Model Transformed into a Database Design?
Representing relationships 1:N relationships N:M relationships Earlier, we looked at E-R diagrams. In those diagrams, we discussed maximum cardinality. Examples of maximum cardinality are 1:N and N:M relationships. Earlier, we also discussed foreign keys and mentioned that foreign keys are used to link tables to one another. In 1:N relationships, we need to consider which table will receive the foreign key. In N:M relationships, we need to create an additional table to form the relationships. Copyright © 2015 Pearson Education, Inc.
24
How Is a Data Model Transformed into a Database Design?
What is the user’s role in the development of databases? Users are final judges as to the data in the database Users should review the data models before developing the database We previously mentioned that users create the requirements for data that need to go into the database. Developers then convert those requirements into data models. To ensure the database contains the data required by the users and the relationships are correct, it’s essential that the users are involved and review the data models before they are developed into the database. Copyright © 2015 Pearson Education, Inc.
25
Why Are NoSQL and Big Data Important?
Nonrelational DBMS NoSQL Because of the growing amount of data created these days, companies like Amazon.com, Google, and Facebook realized that the relational database technology wouldn’t be able to meet their processing needs. Each in turn created a nonrelational data store. Today, nonrelational DBMS are referred to as NoSQL DBMS. Copyright © 2015 Pearson Education, Inc.
26
Why are NoSQL and Big Data Important?
Will NoSQL replace relational DBMS? How does Big Data differ from relational data? Though it’s easy to see the benefits of a NoSQL DBMS, it’s not for everyone at this time. NoSQL DBMS are very technical and beyond the skill of most business professionals. However, the rise of NoSQL does mean that when selecting a DBMS for organizational IS, there are viable choices other than relational products. Big Data is used to describe data collections that differ from relational databases by their huge volume, rapid velocity, and great variety. Considering volume, Big Data refers to data sets that are at least a petabyte in size, and usually larger. A data set containing all Google searches in the United States on a given day is Big Data in size. Copyright © 2015 Pearson Education, Inc.
27
How Can the Intramural League Improve its Database?
Opening Vignette: Intramural problems Process problem Database problem In this chapter’s opening vignette, your textbook describes a scenario in which the intramural league is experiencing some problems. The first problem is one related to the process producing missing equipment reports. Since this is a process problem, we’ll address handling of such problems in the next chapter. For now, we want to focus on the database problem they are experiencing. The problem they’re experiencing is that the current database allocates equipment to teams, but not to the coaches who are responsible for the equipment. In addition, teams can have different coaches in different seasons. This problem needs to be resolved. Copyright © 2015 Pearson Education, Inc.
28
How Can the Intramural League Improve its Database?
League Database, Revision 1 Update “Team” table with “Season” field Rename the table “Team_Season” We have identified that part of the problem lies in the fact that teams can have different coaches in different seasons. So we will create a field in the “Team” table. In doing so, we’ve changed the theme of that table; therefore, it would be best to rename that table as “Team_Season”. This creates a new problem whereby we could have a coach serve as a coach for more than one season, creating a data integrity problem. In the next slide, we’ll address that issue. Copyright © 2015 Pearson Education, Inc.
29
How Can the Intramural League Improve its Database?
Database Revision 1 Here we’re looking at the E-R diagram. As you can see, we have data integrity issues because the “Team_Season” table has two themes. We need to remove the “Coach” from this table. To do that, we use normalization. Copyright © 2015 Pearson Education, Inc.
30
How Can the Intramural League Improve its Database?
Database Revision 2 Now we can see positive results from our changes to the database design. As a result of normalization, we now have two tables with single themes. We also see that we’ve added a field to the “Coach” table. That field represents the amount due for any unreturned equipment, thereby addressing this as a responsibility of the coach. We now have a database design with no data integrity issues. Copyright © 2015 Pearson Education, Inc.
31
How Can the Intramural League Improve its Database?
Opening Vignette: Intramural problems Process problem Database problem Using effective database design, we’ve address the intramural league’s database problem. Copyright © 2015 Pearson Education, Inc.
32
Copyright © 2015 Pearson Education, Inc.
Ethics Guide Querying Inequality? MaryAnn accidentally uncovers potential discrimination data in the database What should she do? Discussion Questions This is an interesting scenario. In this Ethics Guide, a data analyst named MaryAnn is responsible for analyzing employee salaries and evaluating how well they fit into select categories. In doing so, she uncovers potential discrimination in salary ranges. Read the Ethics Guide and ask yourself how you would respond if you were MaryAnn. Address the discussion questions that follow. Copyright © 2015 Pearson Education, Inc.
33
Copyright © 2015 Pearson Education, Inc.
Conclusion Q1. What is the purpose of a database? Q2. What are the contents of a database? Q3. What are the components of a database application system? Q4. How do data models facilitate database design? We began our discussion with an understanding of what databases are and why they’re used. We also discussed differences between databases and data in spreadsheets. Next, we defined contents of a database, like metadata, entities, fields, tables, primary and foreign keys, as well as relationships. After a discussion on the contents of a database, we discussed components of a database application system. Included in that discussion was databaases, the DBMS, and database applications. After learning about database application systems, we talked about data models and how relationships are defined in data models. We reviewed E-R diagrams that showed such relationships. Copyright © 2015 Pearson Education, Inc.
34
Copyright © 2015 Pearson Education, Inc.
Conclusion Q5. How is a data model transformed into a database design? Q6. Why are NoSQL and Big Data important? Q7. How can the intramural league improve its database? After our discussion on data models, we saw how data models are transformed into database design. We were introduced to the concept of normalization at this time. Additionally, we emphasized how important it is for users to be involved in database design. After all, it’s the users who define which data go into the database, so users really need to take an active role in reviewing data models to examine the data and relationships. We also learned what a nonrelational DBMS is, as well as big data. Finally, we reviewed the opening vignette regarding the intramural league and its database problems. We demonstrated how to design a database to resolve their problems. Copyright © 2015 Pearson Education, Inc.
35
Copyright © 2015 Pearson Education, Inc.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Copyright © 2015 Pearson Education, Inc.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.