Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Chapter 4 Database Processing


Published on

  • Be the first to comment

  • Be the first to like this

Chapter 4 Database Processing

  1. 1. Chapter 4 Database Processing
  2. 2. Agenda <ul><li>Purpose of Database </li></ul><ul><li>Terminology </li></ul><ul><li>Components of Database System </li></ul><ul><li>Multi-user Processing </li></ul><ul><li>Database Design </li></ul><ul><li>Entity-relationship Model </li></ul><ul><li>Database Administration </li></ul><ul><li>Database Security </li></ul><ul><li>Discussion, Design, and Case Study </li></ul>
  3. 3. Purpose of Database <ul><li>to keep track of things that involve more than one theme </li></ul>
  4. 4. Terminology - I <ul><li>Database </li></ul><ul><ul><li>A collection of self-describing and integrated records </li></ul></ul><ul><li>The hierarchy of data elements </li></ul><ul><ul><li>Bytes – columns – fields – rows (records) – tables (files or relations) – database </li></ul></ul><ul><li>Database </li></ul><ul><ul><li>A collection of tables plus relationships (in terms of) among rows (records) in these tables </li></ul></ul><ul><li>Relationships </li></ul><ul><ul><li>Primary key: a column or group of columns to identify a unique row in a table </li></ul></ul><ul><ul><li>Foreign key: a non-key column or field in one table that links to a primary key in another table </li></ul></ul>
  5. 5. Hierarchy of Data Elements
  6. 6. Examples of Relationships Among Rows
  7. 7. Terminology - II <ul><li>Relational database </li></ul><ul><ul><li>Tables </li></ul></ul><ul><ul><li>Relationship using primary key and foreign key </li></ul></ul><ul><li>Metadata </li></ul><ul><ul><li>The structure of the database </li></ul></ul><ul><ul><li>The data describe the data </li></ul></ul><ul><ul><ul><li>Field name, data type, description, property </li></ul></ul></ul>
  8. 8. Metadata Example (in Access)
  9. 9. Components of a Database
  10. 10. Components of Database System <ul><li>Database management system (DBMS): software </li></ul><ul><ul><li>To create tables, relationships, and other structure </li></ul></ul><ul><ul><li>To process (read, insert, modify, or delete) data </li></ul></ul><ul><ul><li>To produce forms, reports, and queries through database application </li></ul></ul><ul><ul><li>To administer (security, back up, recover, clean up, and enhance performance) a database </li></ul></ul><ul><li>Structured Query Language (SQL) </li></ul><ul><ul><li>An international standard language for processing a database </li></ul></ul><ul><li>Product types </li></ul><ul><ul><li>Enterprise DBMS: IBM (DB2), Microsoft (SQL Server), Oracle Corporation (Oracle), Open-source (MySQL) </li></ul></ul><ul><ul><li>Personnel DBMS: Microsoft (Access) for 15 or less users </li></ul></ul>
  11. 11. Components of a Database Application System
  12. 12. Use of Multiple Database Applications
  13. 13. Four Application Programs on Web Server Computer
  14. 14. Multi-user Processing <ul><li>More than one user accessing a particular database table at same time </li></ul><ul><li>Lost-update problem </li></ul><ul><li>Lock </li></ul>
  15. 15. Database Design <ul><li>Create data model </li></ul><ul><ul><li>Logical representation of database based on users view on the business environment (user’s requirements) </li></ul></ul><ul><ul><li>Data and relationships that users want to track </li></ul></ul><ul><li>Create database design </li></ul><ul><ul><li>The process of converting a data model into tables, relationships, and data constraints </li></ul></ul><ul><ul><li>Normalization: the process of converting poorly structured tables into two or more well-structured tables to avoid data integrity problems </li></ul></ul><ul><li>Users’ reveiw </li></ul><ul><li>Create database </li></ul>
  16. 16. Entity Relationship Model - I <ul><li>Components </li></ul><ul><ul><li>Entity: physical object (rectangular) </li></ul></ul><ul><ul><li>Attributes: characteristics of the entity </li></ul></ul><ul><ul><li>Primary key: identifier </li></ul></ul><ul><ul><li>Relationship: primary key and foreign key (line) </li></ul></ul><ul><li>Normalization </li></ul><ul><ul><li>The process of converting poorly structured tables into two or more well-structured tables </li></ul></ul><ul><ul><li>Every table describe a single topic or theme </li></ul></ul><ul><ul><li>To avoid data integrity problems </li></ul></ul><ul><ul><li>To avoid generating incorrect and inconsistent information </li></ul></ul><ul><ul><li>Trade off between performance </li></ul></ul><ul><ul><li>Normal form </li></ul></ul>
  17. 17. Entity Relationship Model - II <ul><li>Entity-relationship diagram </li></ul><ul><ul><li>Entity: rectangular </li></ul></ul><ul><ul><li>Relationship: line </li></ul></ul><ul><ul><ul><li>One-to-one: 1:1 </li></ul></ul></ul><ul><ul><ul><li>One-to-many (crow’s foot): 1:N </li></ul></ul></ul><ul><ul><ul><li>Many-to-many: N:M </li></ul></ul></ul><ul><ul><ul><li>Many-to-many relationship has to be changed to two 1:N relationship via an intersection table </li></ul></ul></ul><ul><ul><ul><li>Maximum cardinality </li></ul></ul></ul><ul><ul><ul><li>Minimum cardinality </li></ul></ul></ul>
  18. 18. Database Development Process
  19. 19. Example Relationships Showing Minimum Cardinalities
  20. 20. Transforming a Data Model into a Database Design
  21. 21. Representing a 1:N Relationship - I
  22. 22. Representing a 1:N Relationship - II
  23. 23. Representing a N:M Relationship
  24. 24. Database Administration - I <ul><li>Functions </li></ul><ul><ul><li>Manage the development, operation, and maintenance of a database to achieve the organization’s objectives </li></ul></ul><ul><ul><li>Balance conflicting goals to protect the database and maximize its availability for authorized use </li></ul></ul><ul><li>DBA </li></ul><ul><ul><li>Database administrator or office of database administration </li></ul></ul><ul><ul><li>an auditor, a consultant, sometimes a policeman, and a diplomat working as a liaison between the users and professional developers </li></ul></ul>
  25. 25. Database Administration - II <ul><li>DBA responsibilities </li></ul><ul><ul><li>Database development </li></ul></ul><ul><ul><li>Database operation </li></ul></ul><ul><ul><li>Backup and recovery </li></ul></ul><ul><ul><li>Adopt new database change requirements </li></ul></ul><ul><ul><li>Create a steering committee consisting of key users </li></ul></ul><ul><li>Steering committee </li></ul><ul><ul><li>Community-wide decisions regarding the development, use, and maintenance of the database </li></ul></ul><ul><ul><li>Community-wide policies for the processing of the database </li></ul></ul><ul><ul><li>Processing rights (minimum) </li></ul></ul>
  26. 26. Database Security <ul><li>Firewall </li></ul><ul><li>OS and DBMS patches </li></ul><ul><li>Physical access security </li></ul><ul><li>User accounts, roles, and minimum permission </li></ul><ul><li>Processing and error logs </li></ul><ul><li>Security emergency plan </li></ul>
  27. 27. Discussion <ul><li>Ethics (81a-b) </li></ul><ul><ul><li>What should the company do to avoid the situation at first place? </li></ul></ul><ul><ul><li>What should the company do to properly handle Kelly’s case </li></ul></ul><ul><ul><li>What should Kelly do to avoid the stated consequence after querying the database? </li></ul></ul><ul><ul><li>What could Kelly do to save his career? </li></ul></ul><ul><li>Opposing forces (97a-b) </li></ul><ul><ul><li>What should the DBA of car dealer do to convince every salesperson to build and use a solid sales information database? </li></ul></ul><ul><li>Reflections (101a-b) </li></ul><ul><ul><li>What should the DBA of any organization to handle the changing requirements for a new database? </li></ul></ul><ul><ul><li>What should the DBA of any organization to handle the new requirements for a existing database? </li></ul></ul>
  28. 28. Relational Database Design <ul><li>Given the following entities and their attributes </li></ul><ul><ul><li>Buyer (BuyerID, BuyerName) </li></ul></ul><ul><ul><li>Owner (OwnerID, OwnerName) </li></ul></ul><ul><ul><li>Property (PropertyID, PropertyAddres, OwnerID) </li></ul></ul><ul><ul><li>Agent (AgentID, AgentName) </li></ul></ul><ul><ul><li>Sales (SalesID, BuyerID, OwnerID, PropertyID, AgentID, Price, Date) </li></ul></ul><ul><li>Design a relational database </li></ul><ul><ul><li>Create primary key for every entity and the necessary foreign key </li></ul></ul><ul><ul><li>Create an entity-relationship diagram </li></ul></ul>
  29. 29. Case Study <ul><li>Assignment 22 (105) </li></ul><ul><li>Case 4-1 (107-110): questions 1, 4, and 7 (add aircraft for 7) </li></ul><ul><li>Case 4-2 (110-113): questions 1 and 2 </li></ul>
  30. 30. Points to Remember <ul><li>Purpose of Database </li></ul><ul><li>Terminology </li></ul><ul><li>Components of Database System </li></ul><ul><li>Multi-user Processing </li></ul><ul><li>Database Design </li></ul><ul><li>Entity-relationship Model </li></ul><ul><li>Database Administration </li></ul><ul><li>Database Security </li></ul><ul><li>Discussion, Design, and Case Study </li></ul>