Dbms ii mca-ch1-ch2-intro-datamodel-2013

  • View

  • Download

Embed Size (px)

Text of Dbms ii mca-ch1-ch2-intro-datamodel-2013

  1. 1. Data Base Management System [DBMS] Chapter 1 Unit I Aruna (DSCASC) 1
  2. 2. Introduction A Database Management System (DBMS) is a collection of programs or software package that enables users to create and maintain a database. Defining a database involves specifying the data types, structures, and constraints of the data to be stored in the database. * * Aruna (DSCASC) 2
  3. 3. File Management Systems Uncontrolled Redundancy Inconsistent data Limited data sharing Difficulty in accessing data Security problems Huge data storage problem Excessive program maintenance Excessive data maintenance Aruna (DSCASC) Drawbacks 3
  4. 4. File Processing Systems Aruna (DSCASC) 4 Duplicate Data
  5. 5. Data redundancy and inconsistency Redundancy: Duplication of information in different files. (the same data are stored in many different locations is known as Data Redundancy.) Inconsistency: Same data with different formats (this happen because the update are not properly done at all places.) Integrity problems Data integrity is the assurance that data is correct and consistent--that the data correctly reflects the "real" world. Integrity constraints (e.g. account balance > 0) Hard to add new constraints or change existing ones. Atomicity of updates Failures may leave database in an inconsistent state with partial updates carried out. Example: Transfer of funds from one account to another should either complete or not happen at all. Disadvantages of File Processing Aruna (DSCASC) 5
  6. 6. Difficulty in accessing data Need to write a new program to carry out each new task. Concurrent access by multiple users Uncontrolled concurrent accesses can lead to inconsistencies. Example: Two people use the data and updating it at the same time. Security problems Hard to provide user access to some, but not all, data. Disadvantages of File Processing (Cont.,) Aruna (DSCASC) 6
  7. 7. Data: Meaningful facts, text, graphics, images, sound, video segments. Database: An organized collection of logically related data. Information: Data processed to be useful in decision making. Metadata: Data that describes data. [The database definition or descriptive information is also stored by the DBMS in the form of a database catalog or dictionary; it is called meta-data] Database Management System (DBMS): A software package/ system to facilitate the creation and maintenance of a computerized database. (OR) a collection of programs and tools to create & maintain a database. Database System: The DBMS software together with the data itself. Sometimes, the applications are also included. Definition DBMS Aruna (DSCASC) 7
  8. 8. Define a database: In terms of data types, structures and constraints. Construct or Load the Database on a secondary storage medium. Manipulating the database : Query, generating reports, insertions, deletions and modifications to its content. Concurrent Processing and Sharing by a set of users and programs yet, keeping all data valid and consistent. Protection or Security measures to prevent unauthorized access. Typical DBMS Functionality Aruna (DSCASC) 8
  9. 9. Database system Environment Users/Programmers Application Programs/Queries Software to Process Queries / Programs Software to Access Stored Data DBMS Software Database System Stored Database Definition (Metadata) Stored Database Aruna (DSCASC) 9
  10. 10. DBMS manages data resources like an operating system manages hardware resources DBMSDBMS Database containing centralized shared data Application #1 Application #2 Application #3 Database Management System Aruna (DSCASC) 10
  11. 11. Database Management System Approach Controlled Redundancy consistency of data & integrity constraints Integration of data self-contained & represents semantics of application Data and operation sharing multiple interfaces Services & Controls security & privacy controls backup & recovery enforcement of standards Flexibility data independence data accessibility reduced program maintenance Ease of application development Aruna (DSCASC) 11
  12. 12. What is a Database Management System? A collection of programs and tools to create and maintain a Database. Defining: Specifying types of data Constructing: Storing Manipulating: Querying, Updating, Reporting Aruna (DSCASC) 12
  13. 13. Example of Database UNIVERSITY DATABASE Information about students, courses, and grades in a university are gathered. To construct the UNIVERSITY database, we store data to represent each student, course, section, grade report, and prerequisite as a record in the appropriate file. To define the database, we must specify the structure (metadata) of the records of each file by specifying the different types of data elements to be stored in each record. Aruna (DSCASC) 13
  14. 14. Description: Properties or characteristics of the data, including data types, field sizes, allowable values, and documentation Metadata Name Type Length Min Max Description Name Alphanumeric 30 Student Name Student Number Integer 1 1 9 Student No Class Alphanumeric 15 Class Major Alphanumeric 15 Major STUDENT Aruna (DSCASC) 14
  15. 15. A database that stores student and course information Name Student_number Class Major Smith 17 1 CS Brown 8 2 CS 1) STUDENT Course_name Course_number Credit_hours Department Intro to Computer Science CS1310 4 CS Data Structures CS3320 4 CS Discrete Mathematics MATH2410 3 MATH Database CS3380 3 CS 2) COURSE Course_number Prerequisite_number CS3380 CS3320 CS3380 MATH2410 CS3320 CS1310 3) PREREQUISITE 15
  16. 16. A database that stores student and course information (Cont---) Section_identifier Course_number Semester Year Instructor 85 MATH2410 Fall 07 King 92 CS1310 Fall 07 Anderson 102 CS3320 Spring 08 Knuth 112 MATH2410 Fall 08 Chang 119 CS1310 Fall 08 Anderson 135 CS3380 Fall 08 Stone 4) SECTION 5) GRADE_REPORT Student_number Section_identifier Grade 17 112 B 17 119 C 8 85 A 8 92 A 8 102 B 8 135 A 16
  17. 17. Applications of Database System Banking Airlines University Railways Finance Sales Telecommunication Pay roll system Manufacturing Aruna (DSCASC) 17
  18. 18. Characteristics of the Database Approach In file processing, each user defines and implements the files needed for a specific software application as part of programming the application. For example: One department, the grade reporting office, may keep files on students and their grades. A second department, the accounting office, may keep track of students fees and their payments. Third department, library, keeps track of students details and borrowing of books. Aruna (DSCASC) 18
  19. 19. All these departments are interested in data about students, each department maintains separate files and programs to manipulate these files. In file processing, redundancy of data and storing data results in wasted storage space. In the database approach, a single repository maintains data that is defined once and then accessed by various users. Characteristics of the Database Approach Aruna (DSCASC) 19
  20. 20. Characteristics of the Database Approach Self-describing nature of a database system. Insulation between programs and data, and data abstraction. Support of multiple views of the data. Sharing of data and multiuser transaction processing. Aruna (DSCASC) 20
  21. 21. 1) Self-describing nature of a database system: * The database system contains not only the database itself but also a complete definition or description of the database structure and constraints. * A DBMS catalog stores the description or definition of the database. ( i.e., it contains information such as the structure of each file, the type and storage format of each data item, and various constraints on the data) * The description stored in the catalog is called meta-data. * The Software or programs must work equally well with any number of database applications as long as the database definition is stored in the catalog. * It can access the database by extracting the DB definitions from the catalog and then using these definitions. Characteristics of the Database Approach Aruna (DSCASC) 21
  22. 22. 2) Insulation between programs and data: In file processing, the structure of data files is embedded in the application programs, so any changes to the structure of a file may require changing all programs that access that file. In DBMS access programs do not require such changes in most cases. The structure of data files is stored in the DBMS catalog separately from the access programs. We call this property program-data independence. The characteristic that allows program-data independence and program-operation independence is called data abstraction. (OR A data model is used to hide storage details and present the users with a conceptual view of the database.) Characteristics of the Database Approach Aruna (DSCASC) 22
  23. 23. 3) Support of multiple views of the data: Each user may see a different view of the database, which describes only the data of interest to that user. 4) Sharing of data and multi-user transaction processing : Allowing a set of concurrent users to retrieve and to update the database. Concurrency control within the DBMS guarantees that each transaction is correctly executed or completely aborted. Example: Airlines Reservation These types of applications are generally called online transaction processing (OLTP) applications. Characteristics of the Database Approach Aruna (DSCASC) 23
  24. 24. Users may be divided into Actors on the scene - Those who actually use and control the content. Workers behind the scene - Those who enable the database to be developed and the DBMS software to be designed and implemented. Database Users Aruna (DSCASC) 24
  25. 25. Database administr