Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 13 Database Management Systems: Getting Data Together.

Similar presentations


Presentation on theme: "Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 13 Database Management Systems: Getting Data Together."— Presentation transcript:

1 Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 13 Database Management Systems: Getting Data Together

2 2Copyright © 2003 by Prentice Hall Objectives Describe the hierarchy of data Explain the differences between files and databases List the four database models Describe the concept of data integrity Describe the functions of a database management system

3 3Copyright © 2003 by Prentice Hall Objectives Describe the process of creating a database in general terms Compare and contrast relational and object-oriented databases Explain what a data warehouse is and how it differs from a database

4 4Copyright © 2003 by Prentice Hall The Hierarchy of Data Field – a group of one or more characters that has a specific meaning The smallest meaningful unit of data The smallest meaningful unit of data Describes one characteristic of a person, place, or thing Describes one characteristic of a person, place, or thing Record – the set of fields containing data about a person, place, or thing File – a collection of related records

5 5Copyright © 2003 by Prentice Hall Files and Databases Traditionally, information systems were developed with a file processing approach file processing approachfile processing approach Database approach Database approach creates separate files for each entity Database approach

6 6Copyright © 2003 by Prentice Hall File System Approach Each application had its own file Data was not shared among applications Data was not shared among applications Resulted in a great deal of data redundancy, the repetition of the same data values Increased the risk of inaccurate data Increased the risk of inaccurate data Increased the amount of storage space needed Increased the amount of storage space needed Return

7 7Copyright © 2003 by Prentice Hall The Database Approach A collection of related tables In database technology, a file is called a table In database technology, a file is called a table Each entity is stored in a separate table Each entity is stored in a separate table Tables are linked by a relationship between primary and foreign keys Tables are linked by a relationship between primary and foreign keys primaryforeign primaryforeign Return

8 8Copyright © 2003 by Prentice Hall Primary Key A field that uniquely identifies a record SalesID can be a primary key for the Salesperson table SalesID can be a primary key for the Salesperson table Once a SalesID appears in the table, no other salesperson can have that ID Once a SalesID appears in the table, no other salesperson can have that ID Return

9 9Copyright © 2003 by Prentice Hall Foreign Key A field in one table that is a primary key in another table SalesID can be used in the Customer table to identify the salesperson who serves that customer SalesID can be used in the Customer table to identify the salesperson who serves that customer The same SalesID can appear in many customer records (a salesperson can serve many customers) The same SalesID can appear in many customer records (a salesperson can serve many customers) Return

10 10Copyright © 2003 by Prentice Hall Database Models Define the way a database organizes data Four main models Hierarchical Hierarchical Hierarchical Network Network Network Relational Relational Relational Object-oriented Object-oriented Object-oriented

11 11Copyright © 2003 by Prentice Hall Hierarchical Model Arranges data in hierarchical “parent-child” relationship Each parent record can have many child records Each parent record can have many child records Each child record has only one parent record Each child record has only one parent record Complex and inflexible Return

12 12Copyright © 2003 by Prentice Hall Network Model Arranges data in complex network of “parent-child” relationships Each parent record can have many child records Each parent record can have many child records Each child record can have many parent records Each child record can have many parent records Complex and inflexible Return

13 13Copyright © 2003 by Prentice Hall Relational Model Data organized in table format Columns represent fields Columns represent fields Rows represent records Rows represent records Tables related by primary/foreign key relationship Most current database development uses this model Return

14 14Copyright © 2003 by Prentice Hall Object-Oriented Model Designed to deal with complex data types Focuses on the object An object represents an entity An object represents an entity Represents data about that entity and the types of operations that change that entity Represents data about that entity and the types of operations that change that entity Return

15 15Copyright © 2003 by Prentice Hall Data Integrity Refers to the degree to which data is accurate and reliable Integrity constraints Integrity constraints – rules all data must follow Integrity constraints If integrity constraints are not followed, the data is unreliable If integrity constraints are not followed, the data is unreliable

16 16Copyright © 2003 by Prentice Hall Integrity Constraints Define acceptable values for a field For example, the value of a month cannot be greater than 12 For example, the value of a month cannot be greater than 12 Primary keys cannot be duplicated Foreign keys cannot be used unless they exist as a primary key A SalesID that is used in the customer table must exist as a primary key in the salesperson table A SalesID that is used in the customer table must exist as a primary key in the salesperson table Return

17 17Copyright © 2003 by Prentice Hall Database Management Database Management System (DBMS) – allows you to create a database and enter, modify, and retrieve data as needed Available at all levels Sophisticated systems for a mainframe environment Sophisticated systems for a mainframe environment Inexpensive, easy-to-use personal computer systems Inexpensive, easy-to-use personal computer systems

18 18Copyright © 2003 by Prentice Hall Database Features Data dictionary Data dictionary Data maintenance Data maintenance Data retrieval Data retrieval Concurrency control Concurrency control Security Backup and recovery Backup and recovery

19 19Copyright © 2003 by Prentice Hall Data Dictionary Stores data about the tables and fields within the database For each table, it stores the table name and relationships to other tables For each table, it stores the table name and relationships to other tables For each field, it records information about that field For each field, it records information about that field Also called a catalog Return

20 20Copyright © 2003 by Prentice Hall Data Maintenance Three basic operations Adding new data Adding new data Modifying existing data Modifying existing data Deleting data Deleting data Two methods for performing operations Interacting directly with the DBMS Interacting directly with the DBMS Using programs to access the data using special commands Using programs to access the data using special commands Return

21 21Copyright © 2003 by Prentice Hall Data Retrieval Involves extracting the desired data Two primary forms of data retrieval Queries Queries Queries Reports Reports Reports Return

22 22Copyright © 2003 by Prentice Hall Queries You present a set of criteria; the DBMS selects matching data from the database Use a query language Structured Query Language (SQL) is supported by most relational databases Structured Query Language (SQL) is supported by most relational databases Structured Query Language Structured Query Language Query-by-example (QBE) uses a graphical interface to generate the SQL Query-by-example (QBE) uses a graphical interface to generate the SQL Query-by-example Display results in a table-like grid Display results in a table-like grid Display results Display results Return

23 23Copyright © 2003 by Prentice Hall SQL Uses English-like statements SELECT specifies the field(s) to be selected SELECT specifies the field(s) to be selected FROM specifies the table(s) containing the fields FROM specifies the table(s) containing the fields JOIN specifies the relationship between tables JOIN specifies the relationship between tables WHERE specifies the criteria that must be met WHERE specifies the criteria that must be met Return

24 24Copyright © 2003 by Prentice Hall Query by Example User adds tables to query User drags fields down into grid at bottom of window User drags fields down into grid at bottom of window Criteria can be added by typing them in the Criteria row of the grid Criteria can be added by typing them in the Criteria row of the grid Use can execute the query by clicking an icon on a toolbar Return

25 25Copyright © 2003 by Prentice Hall Query Results Retrieved records are displayed as rows Fields specified in the select clause are displayed as columns Return

26 26Copyright © 2003 by Prentice Hall Reports Provide a formatted presentation of data from the database Allow you to group reports and total by group, if desired Allow you to group reports and total by group, if desired Normally contain more data than queries Normally contain more data than queries Reports are designed with a report generator Return

27 27Copyright © 2003 by Prentice Hall Concurrency Control Manages simultaneous database users If several users tried to update the same record at the same time, updates might not be processed correctly If several users tried to update the same record at the same time, updates might not be processed correctly Employs a record-locking scheme Once a user accesses a record, it is locked until the first update is complete Once a user accesses a record, it is locked until the first update is complete Return

28 28Copyright © 2003 by Prentice Hall Security Many security features are built into most DBMS software Users can be required to enter a user ID and password Users can be required to enter a user ID and password Each user ID may have different access to the data Each user ID may have different access to the data Read-only – permits the user to look at the data but not change it Update – permits the user to make changes to the data No privileges – user can not read or update the data Return

29 29Copyright © 2003 by Prentice Hall Backup and Recovery Backup – a copy of the database Backups should be made periodically Backups should be made periodically Recovery – replaces a damaged database with the good backup Return

30 30Copyright © 2003 by Prentice Hall Creating and Using a Database Creating the database Creating the database Determining the table structure Determining the table structure Setting up the file structure Setting up the file structure Entering the data Entering the data Using the database Using the database

31 31Copyright © 2003 by Prentice Hall Creating the Database Consider your needs Reports you will need Reports you will need Inquiries you will want to make Inquiries you will want to make Return

32 32Copyright © 2003 by Prentice Hall Determining the Table Structure Sketch the table structure – what kind of data is needed in each column Determine characteristics of field Field name Field name Each field must have a unique field name Field type Field type Field type Field type Field width Field width The maximum number of characters, including decimal places Return

33 33Copyright © 2003 by Prentice Hall Field Types Character fields – contain descriptive data Numeric fields – contain numbers used for calculation Specify the number of decimal places Specify the number of decimal places Date fields Logical fields – keep track of true/false or yes/no conditions Return

34 34Copyright © 2003 by Prentice Hall Setting Up the File Structure Design the structure for each table Define the table Define the table Define each field in the table Define each field in the table Define primary key Define primary key Set up the table in design view Return

35 35Copyright © 2003 by Prentice Hall Entering the Data Enter data into the tables in datasheet view Enter data into the tables by using a graphical form Return

36 36Copyright © 2003 by Prentice Hall Using the Database Many operations can be performed to view and modify the data List the records List the records List the records List the records List specific fields List specific fields List specific fields List specific fields Make a query Make a query Make a query Make a query Modify the data Modify the data Modify the data Modify the data Return

37 37Copyright © 2003 by Prentice Hall List the Records Displays the table in datasheet view Displays all rows and all columns Displays all rows and all columns Can be displayed on monitor or printed Return

38 38Copyright © 2003 by Prentice Hall List Specific Fields Displays only the fields you want to view Use SQL to select the desired fields Return

39 39Copyright © 2003 by Prentice Hall Query Use SQL or query-by- example to produce a query Use relational operator to define criteria Use relational operator to define criteria Can be displayed on monitor or printed Can be displayed on monitor or printed Can be formatted into a report Can be formatted into a report Return

40 40Copyright © 2003 by Prentice Hall Modify the Data Add new records Update (make changes to) an existing record Delete records Return

41 41Copyright © 2003 by Prentice Hall The Object-Oriented Database Model Designed to manipulate complex data types Examples include maps and audio and video files Examples include maps and audio and video files The object is the main focus object Designed to incorporate object-oriented programming with large amounts of complex data

42 42Copyright © 2003 by Prentice Hall An Object Represents a real-world entity (person, place, or thing) Includes both the entity and any actions that work with that entity Includes characteristics (properties) of entity Includes characteristics (properties) of entity Includes actions the entity can perform Includes actions the entity can perform Includes actions that can be performed on the entity Includes actions that can be performed on the entity Return

43 43Copyright © 2003 by Prentice Hall Data Warehouses Contain data that has been captured in company databases Can contain data that has been gathered from external sources Can contain data that has been gathered from external sources Use a variety of analytical tools analytical toolsanalytical tools

44 44Copyright © 2003 by Prentice Hall Analytical Tools Online analytical processing (OLAP) software Analyzes data from all databases in the data warehouse Analyzes data from all databases in the data warehouse Provides different “views” of the same data Provides different “views” of the same data Data mining uses sophisticated statistical and artificial intelligence techniques Looks for previously unrecognized patterns, relationships, and trends among the data Looks for previously unrecognized patterns, relationships, and trends among the data Return


Download ppt "Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 13 Database Management Systems: Getting Data Together."

Similar presentations


Ads by Google