Chapter 5 PP Slides


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Chapter 5 PP Slides

  1. 1. 5- Chapter 5 Database Processing
  2. 2. <ul><li>Q1 – What is the purpose of a database? </li></ul><ul><li>Q2 – What is a database? </li></ul><ul><li>Q3 – What are the components of a database application system? </li></ul><ul><li>Q4 – How do database applications make databases more useful? </li></ul><ul><li>Q5 – How are data models used for database development? </li></ul><ul><li>Q6 – How is a data model transformed into a database design? </li></ul><ul><li>Q7 – What is the user’s role in the development of databases? </li></ul><ul><li>Q8 – What are the responsibilities for database administration? </li></ul>5-
  3. 3. <ul><li>As a database user, you play a crucial role in developing database applications for your business or organization. </li></ul><ul><li>A database tracks things involving more than one theme. </li></ul><ul><ul><li>For example: we may want to track customers by: </li></ul></ul><ul><ul><ul><li>Customer number or Last name </li></ul></ul></ul><ul><ul><ul><li>Home address (community tells a lot about a person) </li></ul></ul></ul><ul><ul><ul><li>Number of sales </li></ul></ul></ul><ul><ul><ul><li>Items purchased </li></ul></ul></ul>5-
  4. 4. <ul><li>These are terms you’ll need to know when working with databases. </li></ul><ul><ul><li>A database is a collection of integrated records. </li></ul></ul><ul><ul><li>Bytes , characters of data, are grouped into columns which are also called fields . </li></ul></ul><ul><ul><li>The fields are grouped into rows which are also called records . </li></ul></ul><ul><ul><li>A table is a group of similar rows or records which is also called a file . </li></ul></ul>5-
  5. 5. 5- <ul><li>This figure shows the hierarchy of data elements working from the smallest at the bottom to the largest at the top. </li></ul>
  6. 6. 5- <ul><li>This diagram shows relationships among rows of different tables. </li></ul><ul><li>The Student Number value in the first row of the top table,1325, relates to the same Student Number value in a row in the second table. </li></ul><ul><li>Both that Student Number value and that of 4867 in the second table relate to those in the third. </li></ul>
  7. 7. <ul><li>Keys are a column that identifies a unique row in a table. In the Student Table, the primary key is Student Number. </li></ul><ul><li>A primary key, Student Number, can act as a foreign key in a different table, like the Office Visit Table. </li></ul><ul><li>A relational database </li></ul><ul><li>carries data in the </li></ul><ul><li>form of tables and </li></ul><ul><li>uses foreign keys </li></ul><ul><li>to represent relationships </li></ul>5-
  8. 8. <ul><li>By itself, a database is not very useful because there’s no way to easily manage the data and turn it into useful information. </li></ul><ul><li>A database application system makes database data more accessible and useful by using forms, formatted reports, queries, and application programs to provide useful information to users. </li></ul>5-
  9. 9. <ul><li>A DBMS program is used to create, process, and administer a database. </li></ul><ul><ul><li>Popular DBMS products include: </li></ul></ul><ul><ul><ul><li>DB2 from IBM </li></ul></ul></ul><ul><ul><ul><li>Access from Microsoft (for personal computers) </li></ul></ul></ul><ul><ul><ul><li>SQL Server from Microsoft (for large computer systems) </li></ul></ul></ul><ul><ul><ul><li>Oracle from Oracle Corporation </li></ul></ul></ul><ul><ul><ul><li>MySQL, an open-source product that’s license-free </li></ul></ul></ul><ul><li>It’s easy to confuse a DBMS, which is a software program, with a database, which is a collection of tables, relationships and metadata. But, they are two different concepts. </li></ul>5-
  10. 10. <ul><li>DBMSs are used to process databases by reading, inserting, modifying, or deleting data. </li></ul><ul><ul><li>The Structured Query Language (SQL), is an international standard language used by most major DBMS programs for processing databases. </li></ul></ul><ul><li>A DBMS includes tools to help you administer a database. You can </li></ul><ul><ul><ul><li>Set up a security system that includes permissions and passwords. </li></ul></ul></ul><ul><ul><ul><li>Back up the data to prevent it from being lost or compromised. </li></ul></ul></ul><ul><ul><ul><li>Improve the performance of applications by adding structures. </li></ul></ul></ul><ul><ul><ul><li>Remove data that’s no longer needed. </li></ul></ul></ul>5-
  11. 11. <ul><li>A database application includes forms, reports, queries, and applications programs available to one or more users. </li></ul><ul><li>This figure shows three different applications stemming from a single DBMS and a single database. </li></ul>5-
  12. 12. <ul><li>Data entry forms are used to read, insert, modify, and delete data. </li></ul><ul><li>Reports are used to show data in a structured context as the example to the right shows. </li></ul>© Pearson Prentice Hall 2009 5-
  13. 13. <ul><li>Here’s a comparison of an Enterprise DBMS versus a Personal DBMS. </li></ul>5- <ul><ul><li>Enterprise DBMS </li></ul></ul><ul><ul><ul><li>Large organizational and workgroup databases </li></ul></ul></ul><ul><ul><ul><li>Thousands of users </li></ul></ul></ul><ul><ul><ul><li>Many different database applications </li></ul></ul></ul><ul><ul><ul><li>24/7 operations </li></ul></ul></ul><ul><ul><ul><li>DB2, SQL Server, Oracle </li></ul></ul></ul><ul><ul><li>Personal DBMS </li></ul></ul><ul><ul><ul><li>Smaller, simpler applications </li></ul></ul></ul><ul><ul><ul><li>Personal or small workgroup applications </li></ul></ul></ul><ul><ul><ul><li>Fewer than 100 users </li></ul></ul></ul><ul><ul><ul><li>Microsoft Access is both a DBMS and application development product as this figure depicts. </li></ul></ul></ul>
  14. 14. <ul><li>User involvement is critical for database development for these reasons: </li></ul><ul><ul><li>A database’s design depends on how users view their business environment and how they do their jobs. </li></ul></ul><ul><ul><li>Database developers do not and cannot know what to include because they don’t work with the data everyday. They must rely on users to tell them what data are important and how they’re used. </li></ul></ul><ul><li>A data model is similar to blueprints for a house. It’s a logical representation of database data that describes data and their relationships. </li></ul>© Pearson Prentice Hall 2009 5- Fig 5-15 Database Development Process
  15. 15. <ul><li>An entity-relationship data model helps developers define things (entities) that will be stored in the database as they are building a data model. It also defines relationships among those entities. </li></ul><ul><li>Entities are things users want to track. It can be a physical object (inventory items) or a logical transaction (sales order). The names are always singular. </li></ul><ul><li>Each entity has attributes that describe its characteristics. The entity “Order” has attributes like “OrderNumber” and “OrderDate”. </li></ul><ul><li>An identifier is an attribute whose value is associated with one and only one entity instance. “OrderNumber” is the identifier for the “Order” entity because there should only be one number for each order. </li></ul>© Pearson Prentice Hall 2009 5-
  16. 16. <ul><li>Fig 5-16 Student Data Model Entities </li></ul>© Pearson Prentice Hall 2009 5- <ul><li>Student, Department, Advisor, Email, and Office_Visit are the entity names in this model. </li></ul><ul><li>The entity identifiers are StudentNumber, DeptName, and AdvisorName. Not all entities require an identifier. </li></ul>
  17. 17. <ul><li>Relationships join one entity to another entity </li></ul><ul><ul><li>One-to-one – 1:1 </li></ul></ul><ul><ul><li>One-to-many – 1:N </li></ul></ul><ul><ul><li>Many-to-many – N:M </li></ul></ul><ul><li>This diagram shows that each Department Entity can have multiple Adviser Entities in a one-to-many relationship. Adviser Entities can have a many-to-many relationship with Student Entities. </li></ul>5-
  18. 18. <ul><li>The line style between entities describes the type of relationship as shown in the entity-relationship diagram below. </li></ul><ul><li>This diagram depicts crow’s feet between the entities to describe the relationships. It shows a one-to-many (1:M) relationship between Department and Adviser and a many-to-many (N:M) relationship between Adviser and Student entities. </li></ul>5-
  19. 19. 5- <ul><li>Converting a poorly structured table into two or more well-structured tables is called normalization. </li></ul><ul><li>The table below is poorly designed because it includes the DeptName as part of the Employee record, making it difficult to update. </li></ul><ul><li>It also creates data integrity </li></ul><ul><li>problems because </li></ul><ul><li>the DeptName is not </li></ul><ul><li>consistent throughout </li></ul><ul><li>the table after the </li></ul><ul><li>data were updated. </li></ul>
  20. 20. <ul><li>Normalizing the tables by splitting the Department data into a separate table, as shown below, allows each table to describe a single topic or theme. The tables have been transformed into a normal form. </li></ul><ul><li>By eliminating the duplicate data, you eliminate data integrity problems. That’s called </li></ul><ul><li>normalizing for data integrity. </li></ul><ul><li>Now, the department </li></ul><ul><ul><li>name only needs to </li></ul></ul><ul><ul><li>be updated in one place </li></ul></ul><ul><ul><li>in the normalized tables. </li></ul></ul>5-
  21. 21. <ul><li>This chart shows the necessary steps to transform a data model into a relational database design. </li></ul>5-
  22. 22. 5- <ul><li>The figures below and on the next slide depict the steps used to create a well structured database that will produce useful information. </li></ul><ul><li>The figure on the left represents the relationship between tables. The figure on the right shows a normalized table for each entity. </li></ul>
  23. 23. 5- <ul><li>The figure below shows how relationships are represented using foreign keys. It’s the last step in transforming a data model into a database design. </li></ul>
  24. 24. <ul><li>Your role in the database development process is to decide what data should be included and how records should relate to one another. </li></ul><ul><li>The best time to change a database structure is during the data modeling stage. It’s easier and cheaper to change your mind before anything is actually built. The costs of correcting the database in time and money later on may be very high. </li></ul><ul><li>Each entity must contain all the data you need to do your job. </li></ul><ul><li>Each relationship must accurately reflect the appropriate view of your business. </li></ul><ul><li>You must be the final judge of how well the database will serve your needs. Do not go forward until the data model is accurate. </li></ul>5-
  25. 25. <ul><li>Databases are an important resource for most businesses. </li></ul><ul><li>As databases touch more aspects of systems and business functions, the utility of a database increases as do potential problems. </li></ul><ul><li>Database administration manages the development, operation, and maintenance of databases. </li></ul><ul><li>Database administration must protect the database and maximize its availability for authorized use. </li></ul>© Pearson Prentice Hall 2009 5-
  26. 26. © Pearson Prentice Hall 2009 5- <ul><li>Database administration tasks are divided into four categories as shown below and on the next slide. </li></ul>
  27. 27. 5-