Introduction to Database Management System
Data vs. Information Data: Information: Raw facts; building blocks of information Unprocessed information Information: Data processed to reveal meaning Accurate, relevant, and timely information is key to good decision making Good decision making is key to survival in global environment
Database Examples Database: A collection of related data. Database is involved like everywhere in our world For example: If we go to bank to deposit or withdraw Make hotel and airline reservation Purchase something on line Buy groceries in supermarkets
Database System Database Management System (DBMS): A software package/system to facilitate the Define, Construct, Manipulate and Share functions of a computerized database.
Database System Database system is a computerized record- keeping system. It is a computerize system whose overall purpose is to store information and to allow users to retrieve and update that information on demand. Information is anything that is significant to the individual or organization concerned. What is database system
Database Systems: Then
Operations Adding new file to database Inserting data into existing files Retrieving data from existing files Deleting data from existing files Changing data in existing files Removing existing files from the database
Data base system Database System are available on machines that range from all the way from personal computers to the largest mainframe Single User system is a system in which at most one user can access the database at any given time. Multi user system is a system in which many users can access the database at the same time.
Database System Components Hardware Software Users
The data in database – for large system- will be both integrated and shared. Mean the database can be thought of as a unification of several distinct files, with any redundancy among those files partly or wholly eliminated Shared Mean the database can be shared among different users, in the sense that different users can have access to the same data.
Hardware The hardware components of the system consist of The secondary storage volumes used to hold the stored data, together with the associated I/O devices, device controllers, and so forth. The hardware processors and associated main memory that are used to supported the execution of the database system software
Software Database Management System (DBMS) Data => physically stored All request for access to the database are handle by the DBMS DBMS is thus shielding of database users from hardware level details Provides users with a perception of the database that is elevated somewhat above the hardware level details. Support user operations
3. Users 2. Software 1. Data 4. Hardware
Database Management System DBMS is a general purpose software system that facilitates the process of definition, construction, manipulating, and sharing databases among various users and applications. Defining a database involves specifying the data types, structures, and constrains for the data to be stored in the database.
Other important functions Manipulating a database includes such functions as querying the database to retrieve specific data, updating the database to reflect changes, and generating reports from data. Sharing a database allows multiple users and programs to access the database concurrently. Other important functions Protection both system protection against hardware or software malfunction (crash) and Security protection against unauthorized or malicious access. DBMS must be able to maintain the database System by allowing the system to evolve as requirements change over time.
User Application Programmer End User Responsible for writing database application programs in some programming language End User Access database interactively as just described, A given user can access the database via online application program or user query language
Database Designers Responsible for identifying the data to be stored in the database and for choosing appropriate structures to represent and store in database. It is responsibility of database designers to communicate with all database user to understand their requirements, and to come up with a design that meets users’ requirements. Designer may be one of staff of Database Administrator (DBA)
Database Administrators: responsible for authorizing access to the database, for coordinating and monitoring its use, and for acquiring software and hardware resource need Defining the conceptual schema (Logical/conceptual Database Design) Defining the internal schema (Physical Database design) Defining security and integrity constraints Monitoring performance and responding to changing requirement.
Software to Access Stored Data DATABASE SYSTEM Users/Programmers Application Programs/Queries DBMS Software Software to Process Quires/Programs Software to Access Stored Data Stored Database Definition (Meta Data) Stored Database
ARCHITECTURE
Database architecture
The three levels The ANSI architecture is divided into three levels— internal, conceptual, and external The external level is the one closest to the users. It Interacts directly with the user. It is the one concerned with the way the data is seen by individual users( external schema) It Change the data coming from the conceptual level to a format and view that are familiar to the users.
The conceptual level defines the logical view of the data. The main functions of DBMS are in this level. It defines what data are to be stored and mentions the relationship that exist between the data The internal level is the one closest to physical storage. It is the one concerned with the way the data is stored inside the system.(internal schema). It determines where and how the data are actually stored on the storage device. It deals with the Low-level access method
The three levels External schema Conceptual Schema Internal Schema External level (individual user views) Conceptual level (community user views) Internal level (storage views) The three levels of the architecture
The three levels Detailed system architecture
Three Level Architecture of DBMS continue… Sales Officer Inventory Controller View 1 Item_Name Price View 2 Item_Name Stock External Level Conceptual Item_Number Character (6) Item_Name Character(30) Price Numeric(5,2) Stock Numeric(4) Conceptual Level Physical Stored_Item Length=50 Item # Type = Byte(6), offset = 0, Index = Ix Name Type = Byte(30), offset = 6 Price Type = Byte(8), offset = 36 Stock Type = Byte(4), offset = 44 Physical Level
External or View Level This level is closest to the users and is concerned with the way in which the data is viewed by individual users. Most of the users are not concerned with all the information contained in the database. Instead they need only a part of the database relevant to them. The system provides many views for the same database.
External or View Level continue… It is the highest level of abstraction of database. It allows to see only the data of interest to the users. Users can be – Application programmers or end-users. Any no. of external views can be viewed from the – external schema.
External or View level continue… It contains the methods for deriving the objects such as entities, attributes and relationships in the external view from the Conceptual View.
Conceptual Level This level of abstraction describes what data are actually stored in the database. It also describes the relationships existing among data. At this level, the database is described logically in terms of simple data-structures. The users of this level are not concerned with how these logical data structures will be implemented at the physical level, rather they just are concerned about what information is to be kept in the database.
Conceptual Level It is the sum total of DBMS users view. continue… It is the sum total of DBMS users view. It describes what data are actually stored in the database (ie,all the records and relationships included in the database).
Conceptual Level continue… The conceptual view is a representation of the entire information content of the database in a form that is some what abstract in comparison with the way in which the data is physically stored.
Conceptual Level continue… The conceptual view is defined by means of the conceptual schema, which includes the definition of each of the various types of conceptual records and the mapping between the conceptual schema and the internal schema.
Internal or Physical Level It is the lowest level of abstraction. It describes how the data are physically stored. Internal view is represented by internal schema (internal schema defines the various types of stored record ,specifies what indexes exists, how files are represented, etc.)
Internal or Physical Level The internal level is closest to physical storage. This level is also termed as physical level. It describes how the data are actually stored on the storage medium. At this level, complex low-level data structures are described in detail.
Mappings conceptual/internal mapping and several external/conceptual mappings: 1.the conceptual/internal mapping defines the correspondence between the conceptual view and the stored database; it specifies how conceptual records and fields are represented at the internal level. 2.an external/conceptual mapping defines the correspondence between a particular external view and the conceptual view.
1.5.2 Mappings External schema Conceptual Schema Internal Schema conceptual/internal mapping external/conceptual
Mappings Data independence: 1.physical data independence is the ability to modify the physical schema without causing application programs to be rewritten. (conceptual/internal mapping) 2.logical data independence is the ability to modify the logical schema without causing application programs to be rewritten. (external/conceptual)
Instances and schemas sn name sex 01 carol female 03 bob male The collection of information stored in the database at a particular moment is called an instance of the database. The overall design of the database is called the database schema. database schema instance of the database Student={sn,name,sex} sn name sex 01 carol female 03 bob male student