Más contenido relacionado


Database, Lecture-1.ppt

  1. Database Management Systems Dr. Md. Rakibul Hoque University of Dhaka
  2. Organizing Data in a Traditional File Environment • File organization Term and Concepts • Computer system organizes data in a hierarchy • Bit: Smallest unit of data; binary digit (0,1) • Byte: Group of bits that represents a single character • Field: Group of characters as word(s) or number • Record: Group of related fields • File: Group of records of same type
  3. Organizing Data in a Traditional File Environment • File organization Term and Concepts • Computer system organizes data in a hierarchy • Database: Group of related files • Entity: Person, place, thing on which we store information. • Attribute: Each characteristic, or quality, describing entity • E.g., Attributes Date or Grade belong to entity COURSE
  4. The Data Hierarchy A computer system organizes data in a hierarchy that starts with the bit, which represents either a 0 or a 1. Bits can be grouped to form a byte to represent one character, number, or symbol. Bytes can be grouped to form a field, and related fields can be grouped to form a record. Related records can be collected to form a file, and related files can be organized into a database. Organizing Data in a Traditional File Environment
  5. Traditional File Processing The use of a traditional approach to file processing encourages each functional area in a corporation to develop specialized applications and files. Each application requires a unique data file that is likely to be a subset of the master file. These subsets of the master file lead to data redundancy and inconsistency, processing inflexibility, and wasted storage resources. Organizing Data in a Traditional File Environment
  6. Database • A database is a collection of information that is organized so that it can easily be accessed, managed, and updated. In one view, databases can be classified according to types of content: bibliographic, full-text, numeric, and images. • A database is a logically coherent collection of data with some inherent meaning, representing some aspect of real world and which is designed, built and populated with data for a specific purpose. A database is not necessarily computerized. It can be generated and maintained manually, or it may be computerized.
  7. Database Databases are used in every part of day-to-day life. Examples of common database use include: depositing or withdrawing money from a bank, making a travel reservation, accessing a library catalog, buying something from the internet etc. These are examples of traditional database applications, where data is stored either in textual or numeric format. Less traditional database applications that are starting to become more popular include multimedia databases, which store pictures, video clips, and sounds, Geographic Information Systems (GIS) that store maps, satellite images and weather data.
  8. Database Management System  A database management system (DBMS) is a collection of interrelated data and a set of programs to access those data. The collection of data, usually referred to a database, contains information relevant to an enterprise.  DBMS is a system that allows inserting, updating, deleting and processing of data.
  9. Database Management System  A database management system is a collection of programs that enable users to create and maintain a database. -----Elmarsi & Navathe  A database management system, or DBMS, is a software designed to assist in maintaining and utilizing large collections of data. --------- Ramakrishnan & Gehrke
  10. Goals/Purposes of DBMS  The primary goal of a DBMS is to provide an environment that is both convenient and efficient for people to use in retrieving and storing information.  Database systems are designed to manage large bodies of information. Management of data involves both defining structures for storage of information and providing mechanisms for manipulation of information.
  11. Goals/Purposes of DBMS  The database system must ensure the safety and security of the information stored, despite system crashes or attempts at unauthorized access.  The system must avoid possible anomalous results if data are to be shared among several users.
  12. Database System Applications Databases are widely used. Some representative applications are: 1. Banking: For customer information, accounts, loans and banking transactions. 2. Airlines/Railways/Road Transport: For ticket reservation, schedules and routes.
  13. Database System Applications 3. Universities: For student information, courses and grades (education management). 4.Credit card transaction: For purchases on credit card, monthly statement generation
  14. Database System Applications 5.Telecommunication: For keeping records of call made, generating monthly bills, maintaining balances on prepaid calling cards, storing information about the communication networks.
  15. Database System Applications 6.Finance: For storing information about holdings, sales, and purchases of financial instruments such as stocks and bonds. 7. Sales: For customer, product and purchase information.
  16. Database System Applications 8. Manufacturing: For management of supply chains and for tracking production of items in factories, inventories of items in warehouses/stores and order for items. 9. Human resources: For information about employees, salaries, payroll taxes and benefits and for generation of pay checks.
  17. Some Commercial Database Management Software  For Personal Computers 1. Microsoft Access 2. FoxPro 3. dBase
  18. Some Commercial Database Management Software 1.Oracle – Oracle 8i, Oracle9i, Oracle 10g, 11g 2. Microsoft SQL Server 3. IBM DB2/DB2UDB 4. Informix 5. Sybase 6. Ingress
  19. Some Open Source Database Management Software 1. CUBRID 2. Firebird 3. MariaDB 4. MongoDB 5. Postgre SQL 6. MySQL 7. SQLite
  20. Database Systems Vs File Systems ( Why DBMS?)  Ordinary file system has a number of major drawbacks: 1. Data redundancy and inconsistency- Multiple file formats, duplication of information in different files. 2.Difficulty in accessing data - Need to write a new program to carry out each new task
  21. Database Systems Vs File Systems ( Why DBMS?) 3.Data isolation -Multiple files and formats 4.Integrity problems - Integrity constraints (e.g. account balance > 0) become part of program code - Hard to add new constraints or change existing ones.
  22. Database Systems Vs File Systems ( Why DBMS?) 5. Atomicity problems - Failures may leave database in an inconsistent state with partial updates carried out. E.g., transfer of funds from one account to another should either complete or not happen at all.
  23. Database Systems Vs File Systems ( Why DBMS?)  6. Concurrent-access anomalies - Needed for system performance and usability - Uncontrolled concurrent accesses can lead to inconsistencies. E.g. two people reading a balance and updating it at the same time.
  24. Database Systems Vs File Systems ( Why DBMS?) 7. Security problems: Not every user of the database system should be able to access all the data. Database systems offer solutions to all these problems
  25. View of Data  A database system is a collection of interrelated files and set of programs that allow users to access and modify these files. A major purpose of a database system is to provide users an abstract view of the data. That is, the system hides certain details of how the data is stored and maintained.
  26. Data Abstraction Several levels of data abstraction are maintained to simplify users’ interaction with the system: 1. Physical level: The lowest level of abstraction describes how data are actually stored. It describes complex low-level data structures in detail.
  27. Data Abstraction  2. Logical level: The next higher level of abstraction describes what data stored in database, and what relationships exist among those data. The logical level thus describes the entire database in terms of a number of relatively simple structures.
  28. Data Abstraction  For Example:  create table customer ( customer_id varchar(10), customer_name varchar (35), customer_street varchar (20), salary number (10,2));
  29. Data Abstraction  3. View level: The highest level of abstraction describes only part of the entire database. Computer users see a set of application programs that hide details of data types. Several views of database are defined and users see these views. In addition to hiding details, the views also provide a security mechanism to prevent users from accessing certain part of the database.
  30. Data Abstraction
  31. Instances and Schemas  Schema: The overall design of the database is called the database schema. Schemas are changed infrequently, if at all. This corresponds to the variable declaration (with type definition) of a programming language.
  32. Instances and Schemas Schemas are: 1.Physical schema: Describes the database design at physical level 2.Logical schema: Describes the database design at logical level 3.View schema: Describes the database design at view level
  33. Instances and Schemas Instances: Databases change over time as information is inserted and deleted. The collection of information stored in the database at a particular moment is called an instance of the database. While executing, each variable of a programming language has a particular value at a given instant. The values of the variable in a program at a point in time correspond to an instance of the database schema.
  34. Instances and Schemas  Physical Data Independence – The ability to modify the physical schema without changing the logical schema is called physical data independence. - Applications depend on the logical schema (or the view schema) - In general, the interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others.
  35. Data Models  A data model is a collection of conceptual tools for describing data, data relationship, data semantics and consistency constraints. A. Base Models: Describes the design of the database at the logical level.
  36. Data Models  A. 1. Entity-Relationship Model: This is a higher-level data model. It is based on a perception of a real world that consists of a collection of basic objects, called entities and the relationship among these objects.
  37. Data Models  Entity: An entity is a “thing” or “object” in the real world that is distinguishable from all other objects. An entity has a set of properties, called attributes and the values for some set of properties/attributes may uniquely identify an entity. An entity may be concrete, such as a person or a book, or it may be abstract, such as loan, or a holiday, or a concept.
  38. Data Models  customer- customer-id, customer- name, customer-street, customer-city  loan – loan-number, amount
  39. Data Models  Relationship: A relationship is an association among several entities. A depositor relationship associates a customer with each account that he or she has. The set of all entities of the same type and the set of all relationships of the same type are termed an entity set and relationship set, respectively
  40. Data Models
  41. Data Models A. 2. Relational Model: This is a lower level model. It uses a collection of tables to represent both data and relationships among those data. Each table has multiple columns, and each column has a unique name.
  42. Data Models  The relational model is an example of a record-based model. This is because the database is structured in fixed-format records of several types. Each table contains records of a particular type. Each record type defines a fixed no. of fields, or attributes. The columns of the table correspond to the attributes of the record type.
  43. Data Models  The relational model is the most widely used data model and a vast majority of current database systems are based on the relational model. The relational model is at a lower level of abstraction than the E-R model. Database designs are often carried out in the E-R model and then translated to the relational model.
  44. Data Models
  45. Data Models  B. Other Models: B. 1. Object-oriented data model: Drawing increasing attention. It can be seen as extending of E-R model with notions of encapsulation, methods (functions) and object identity. An object database (also object-oriented database management system, OODBMS) is a database management system in which information is represented in the form of objects as used in object-oriented programming. Object databases are different from relational databases which are
  46. Data Models
  47. Data Models  B. 2. Object-relational data model: Combines the features of object-oriented data model and relational data model.  An object-relational database (ORD), or object- relational database management system (ORDBMS), is a database management system (DBMS) similar to a relational database, but with an object-oriented database model: objects, classes and inheritance are directly supported in database schemas and in the query language.
  48. Data Models  B. 3. Semi-structured data model: Permits the specification of data where individual data items of the same type may have different sets of attributes. The extensible markup language (XML) is widely used to represent semi-structured data.  The semi-structured model is a database model where there is no separation between the data and the schema, and the amount of structure used depends on the purpose. It can represent the information of some data sources that cannot be constrained by schema.
  49. Data Models
  50. Data Models  C. Historical Models: These are in little use now. C. 1. Network data model C. 2. Hierarchical model
  51. Data Models  The network model is a database model conceived as a flexible way of representing objects and their relationships. Its distinguishing feature is that the schema, viewed as a graph in which object types are nodes and relationship types are arcs, is not restricted to being a hierarchy or lattice.
  52. Network DBMS: • Depicts data logically as many-to-many relationships The Network Data Model Data Models
  54. Data Models  A hierarchical database model is a data model in which the data is organized into a tree-like structure. The data is stored as records which are connected to one another through links. A record is a collection of fields, with each field containing only one value.
  55. Hierarchical DBMS: • Organizes data in a tree-like structure • Supports one-to-many parent-child relationships • Prevalent in large legacy systems Data Models
  56. A Hierarchical Database for a Human Resources System
  57. Thank You