Presentation is loading. Please wait.

Presentation is loading. Please wait.

DATABASE MANAGEMENT SYSTEM

Similar presentations


Presentation on theme: "DATABASE MANAGEMENT SYSTEM"— Presentation transcript:

1 DATABASE MANAGEMENT SYSTEM

2 INTODUCTION Data – fact that can be recorded and that have implicit meaning. Database – collection of related data. Database management system (DBMS) – Collection of interrelated data Set of programs to access the data An environment that is both convenient and efficient to use Exerts centralized control of database, prevents fraudulent or unauthorized users from accessing the data and ensures privacy of data.

3 DATABASE APPLICATIONS
Banking: all transactions Airlines: reservations, schedules Universities: registration, grades Sales: customers, products, purchases Online retailers: order tracking, customized recommendations Manufacturing: production, inventory, orders, supply chain Human resources: employee records, salaries, tax deductions

4 PURPOSE OF DATABASE SYSTEM
In the early days, database applications were built directly on top of file systems Drawbacks of using file systems to store data: Data redundancy and inconsistency Different programmers create files over long period. hence , Multiple file formats and these leads to duplication of information in different files. It may lead to data inconsistency since various copies of the same data may no longer agree Difficulty in accessing data Need to write a new program to carry out each new task Conventional file system do not allow needed data to be retrieved in a convenient and efficient manner. Data isolation — data are scattered in various files and files may be in different formats , writing new application programs to retrieve the appropriate data is difficult.

5 Database systems offer solutions to all the above problems
Integrity problems Integrity constraints (e.g. account balance > 0) become “buried” in program code by developers rather than being stated explicitly. 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 Concurrent access by multiple users Concurrent accessed needed for performance ( multiple users to update data simultaneously ) Uncontrolled concurrent accesses can lead to inconsistencies Example: Two people reading a balance and updating it at the same time Security problems Hard to provide user access to some, but not all, data Database systems offer solutions to all the above problems

6 CHARACTERISTICS OF DATABASE APPROACH
In a db approach, a single repository of data is maintained that is defined once and then accessed by various users. Characteristic :-DB Vs file approach a) self describing nature of a database :- DB system contains database and complete definition db structure and constraints. Definition is stored in database catalog ( contains structure of each file, type , storage format of each data item, constraints on the data ) Information stored in database catalog is called meta-data In file system, data definition is part of the application programs themselves

7 b) Insulation between programs and data, data abstraction :-
Structure of data files is stored in the DBMS catalog separately from access programs. This property is called program-data independence User application programs can operate on the data by invoking operations through names and arguments, regardless of how the operations are implemented. This property is called program-operation independence. Data abstraction – characteristic that allows program-data independence and program-operation independence.

8 c) support of multiple views of the data:-
DB has many users, each may require different perspective or view of database. A view may be subset of the db or contain virtual data that is derived from the database files but not explicitly stored. Eg- user 1 require fees details from student db user 2 require course details. d) Sharing of data and multiuser transaction processing:- Multiuser DBMS must allow multiple users to access the db at the same time. So, DBMS must include concurrency control. Transaction properties :- a) Isolation ( Each transaction appears to execute in isolation from other transaction ) b) Atomicity ( either all the db operations in a transaction are executed or none are )

9 ADVANTAGES OF USING DBMS
Controlling redundancy – centralized control of data by DBA ,avoids unnecessary duplication of data and effectively reduces total amount of data storage required. Providing storage structure for efficient query processing. Restricting unauthorized users – DBA ensures that proper access procedures are followed, including authentication schemes and additional checks before permitting access to sensitive data. Providing concurrency Providing backup and recovery Enforcing integrity constraints - Db applications have integrity constraints that must hold for the data. DBMS must provide capabilities for defining and enforcing these constraints. Data integrity means that the data contained in the database is both accurate and consistent.

10 Shared data – A db allows sharing of data under its control by any number of application programs or users. Ability to associate related data. Improved data administration and control The disadvantages are as follows: -Centralization:That is use of the same program at a time by many user sometimes lead to loss of some data. High cost of software. Technical expertise are required security issues Complexity of backup and recovery

11 DATA ABSTRACTION Db provide users with an abstract view of the data i.e system hides the complexity from user ( how data are stored and maintained) through several levels of abstraction . These are:- 1) Physical level: describes how a record (e.g., customer) is stored. It is the lowest level. 2) Logical level: It is the next higher level. Describes data stored in database, and the relationships among those data. It describes entire db. type customer = record customer_id : string; customer_name : string; customer_street : string; customer_city : string; end; 3) View level: Highest level . Application programs hide details of data types. Views can also hide information (such as an employee’s salary) for security purposes. View level simplifies user interaction with the system. The system may provide many views for the same db.

12 fig. Fig – 3 levels of data abstraction

13 INSTANCES AND SCHEMAS Similar to types and variables in programming languages Schema – the logical structure/design/description of the database Example: The database consists of information about a set of customers and accounts and the relationship between them) Analogous to type information of a variable in a program Physical schema: database design at the physical level Logical schema: database design at the logical level A db may also have several schemas at view level Instance – the actual content of the database at a particular point in time Analogous to the value of a variable ( WHEN DECLARED ) Physical Data Independence – the ability to modify the physical schema without changing the logical schema Applications depend on the logical 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.

14 DATA MODELS A collection of tools for describing -
Data , Data relationships , Data semantics , Data consistency constraints. Data model – used to represent entities and their relationships in the db. Data model classification:- a) File based systems or primitive models:- E-R model b) Traditional data models :-hierarchical , network , relational

15 A) ENTITY RELATIONSHIP MODEL
Based on the perception of a real world objects called entities and relationships among them. Entities can have following type of relationship:- a) one-to-one b) one-to-many c) many-to-many B) RELATIONAL DATA MODEL Proposed in 1970 by E.F Codd DB2 , oracle , SQL server, SYBASE , INFORMIX Model uses relation (table) to represent data and their relationship. Each table have rows (tuple), columns ( as it’s attributes ) and its attribute value (domain) Record based model

16 C) NETWORK DATA MODEL D) HIERARCHICAL MODEL
Formalized in late 1960s by Database Task Group of the conference on Data System Language ( DBTG/CODASYL) DBTG model uses two different data structure :- record type ( for entities ) and set type ( for relationship among them) Able to model complex relationship Relationships as well as navigation through the database is predefined while creating a database. Used in DMS 1100(unisys), image(H.P) D) HIERARCHICAL MODEL Implemented by IBM and North American Rockwell around 1965. Used in system 2k( SAS.) Data is organized in a hierarchical or ordered tree structure .

17 3- SCHEMA ARCHITECTURE Proposed to support db approach characteristics :- a) Insulation of programs and data ( program-data and program-operation independence) b) support of multiple user views c) use of catalog to schema

18 (User 1 view) (User 2 view) (User 3 view) External level / user view /view level External/conceptual mapping Conceptual level/ global view Conceptual/ Internal mapping Internal level

19 Internal level has an internal schema, which describes physical storage structure and access path of the db. Conceptual level has an conceptual schema, describes structure of whole database for a community of users. It hides details of physical storage structures and concentrates on describing entities, data types, relationships, user operations and constraints. External level has number of external schemas or user views. Each external schema describes the part of the db that a particular user group is interested in and hides other db from that user group. Mapping – process of transforming requests and results between levels.

20 DATA INDEPENDENCE Defined as the capacity to change the schema at one level of a db system without having to change at next higher level. Two types :- a) Logical data independence – the capacity to change conceptual schema without having to change the external schemas and their application programs. b) Physical data independence- the capacity to change the internal schema without having to change the conceptual schema.

21 DATABASE LANGUAGES A) DATA MANIPULATION LANGUAGE
Language for accessing and manipulating the data DML also known as query language Two classes of languages Procedural Declarative (nonprocedural) SQL is the most widely used query language Access types – retrieval , insertion , deletion, modification

22 B) DATA DEFINITION LANGUAGE
Specification notation for defining the database schema Example: create table account ( account_number char(10), branch_name char(10), balance integer) DDL compiler generates a set of tables stored in a data dictionary Embedded and stand alone Data dictionary contains metadata (i.e., data about data) Database schema Data storage and definition language Specifies the storage structure and access methods used Integrity constraints Domain constraints Referential integrity (e.g. branch_name must correspond to a valid branch in the branch table) Authorization

23 DATABASE ADMINISTRATOR
Coordinates all the activities of the database system has a good understanding of the enterprise’s information resources and needs. Database administrator's duties include: Storage structure and access method definition Schema and physical organization modification Granting users authority to access the database Backing up data Monitoring jobs running on the db and ensures that performance is not degraded . Administers 3 levels of db.


Download ppt "DATABASE MANAGEMENT SYSTEM"

Similar presentations


Ads by Google