* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download No Slide Title
Concurrency control wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Relational model wikipedia , lookup
Clusterpoint wikipedia , lookup
Data Base Organization and File Structure — Chapter 1 — Suresh Choubey, Ph.D. May 22, 2017 Data Base Organization and File Structure: Introduction 1 Chapter 1: Introduction  What is a data database?  A database is a collection of very large integrated collection of related data  Data are facts about people, event and other entities that can be recorded and that have implicit meaning, e.g., name, address and telephone # of all people we know May 22, 2017 Data Base Organization and File Structure: Introduction 2 Chapter 1: Introduction  Characteristics of a database?  A database is logically coherent collection of data with some inherent meaning  A database is designed, built and populated with data for a specific purpose  A database represents some aspect of real world, called mini world (models real world enterprise)  May 22, 2017 Entities, relationship Data Base Organization and File Structure: Introduction 3 Chapter 1: Introduction  What is a database management system?  Database management systems (DBMS) is a collection of programs that enables users to create (store) and maintain a database. It involves design, construction (storage of data) and manipulation  May 22, 2017 Database systems = DBMS + database Data Base Organization and File Structure: Introduction 4 Chapter 1: Introduction  Characteristics of database approach  Self-contained nature of database systems  Data + meta data + constraints on data are stored together in system catalog   Application programs are independent of data Insulation between programs and data May 22, 2017  DBMS access programs are independent of files  This property is called program-data independence Data Base Organization and File Structure: Introduction 5 Chapter 1: Introduction  Characteristics of database approach(Cont. ….)  Data abstraction:DBMS gives conceptual representation of data, e.g. data model  Support of multiple views of data May 22, 2017  Different users have differing views of database  Virtual data can be derived Data Base Organization and File Structure: Introduction 6 Chapter 1: Introduction  Intended use of DBMS approach  Controlled redundancy  Redundancy causes duplication of efforts, wastage of storage space and inconsistency  Controlled redundancy may be useful in saving access time as some controlled data are stored at more than one place  Sharing of data:  May 22, 2017 Requires concurrency control measures Data Base Organization and File Structure: Introduction 7 Chapter 1: Introduction  Intended use of DBMS approach (Cont. ….)  Restricting unauthorized access   DBMS provides security and authorization subsystems Providing multiple interfaces  Query language for casual users, programming language for application programmers, forms for pragmatic users, menu driven interfaces for native users and natural language interfaces May 22, 2017 Data Base Organization and File Structure: Introduction 8 Chapter 1: Introduction  Intended use of DBMS approach (Cont. ….)  Representing complex relationships among data  Enforcing Integrity constraints  Providing backup and Recovery from crashes  Potential for enforcing standards  Flexibility – can add changes in mini world  Reduced application development time May 22, 2017 Data Base Organization and File Structure: Introduction 9 Chapter 1: Introduction  Intended use of DBMS approach (Cont. ….)  Availability of up-to-date information  Economics of scale   Permits consolidation of data and application Uniform data administration May 22, 2017 Data Base Organization and File Structure: Introduction 10 Chapter 1: Introduction  Disadvantages of DBMS approach  High cost due to high initial investment for h/w and s/w and incorporation of sub-systems for security, concurrency control, recovery and integrity function  Security Problems  Initial development time May 22, 2017 Data Base Organization and File Structure: Introduction 11 Chapter 1: Introduction  File Vs databases (Slide from text book author)  Application must stage large datasets between main memory and secondary storage (e.g., buffering, page-oriented access, 32-bit addressing, etc.)  Special code for different queries  Must protect data from inconsistency due to multiple concurrent users  Crash recovery  Security and access control May 22, 2017 Data Base Organization and File Structure: Introduction 12 Chapter 1: Introduction  Why study databases ? (Slide from text book author)  Shift from computation to information   at the “low end”: scramble to webspace (a mess!)  at the “high end”: scientific applications Datasets increasing in diversity and volume  Digital libraries, interactive video, Human Genome project, EOS project  May 22, 2017 ... need for DBMS exploding Data Base Organization and File Structure: Introduction 13 Chapter 1: Introduction  Why study databases ? (Slide from text book author)  DBMS encompasses most of CS  May 22, 2017 OS, languages, theory, “A”I, multimedia, logic Data Base Organization and File Structure: Introduction 14 Chapter 1: Introduction  Personnel  DBA – responsible for database and DBMS, account allocation, security maintenance   Database designers  Identify data and design data structures  Identify views and combine them DBMS designers and implementers May 22, 2017 Data Base Organization and File Structure: Introduction 15 Chapter 1: Introduction  Personnel (Cont. ….)  End users – access database for querying, updating and generating reports  Casual end users  Naïve or parametric end users – use canned transactions  Sophisticated end users  Tool developers  Operators and maintenance personnel May 22, 2017 Data Base Organization and File Structure: Introduction 16 Chapter 1: Introduction  DBMS can be network, relational, hierarchical and others  DBMS can also be single-user or multi-user  DBMS can be centralized or distributed (DDBMS)  homogeneous(use same DBMS s/w at multiple sites)  Heterogeneous (use s/w to access several autonomous pre-existing database) May 22, 2017 Data Base Organization and File Structure: Introduction 17 Chapter 1: Introduction  Data Models  Is a set of concepts that describes the structure of the database (i.e., data types, relationship and constraints that should hold on data)  Is a set of operators for specifying retrievals and updates on database  Provides abstraction May 22, 2017 Data Base Organization and File Structure: Introduction 18 Chapter 1: Data Models  A schema is a description of a particular collection of data, using the a given data model  The relational model of data is the most widely used model today  Main concept: relation, basically a table with rows and columns  Every relation has a schema, which describes the columns, or fields May 22, 2017 Data Base Organization and File Structure: Introduction 19 Chapter 1: Data Models: Cocepts   High level called object based models  Entity - is an object hat is represented in the database  Attribute – is a property that describes some aspects of object  Relationship Implementation Level – record-based data models such as relational and network  Physical data models – describes how data is stored in the computer by representing information such as record formats, record orderings and access path May 22, 2017 Data Base Organization and File Structure: Introduction 20 Chapter 1: Data Models Database Schemas:Is the description of database. Schema diagrams are used to represent it. Schema diagram consists of schema construct. e.g., Student Name StudName Class  It does not change frequently  Called INTENSION Major Database Instance: Data in database at a particular time or occurrence or state called EXTENSION May 22, 2017 Data Base Organization and File Structure: Introduction 21 Chapter 1: DBMS Architecture (Three schema or ANSI-SPARC) External view - 1 External View - n External level or view level External/Conceptual mapping Conceptual Schema Conceptual level Conceptual/Internal mapping Internal Schema Internal level Stored database May 22, 2017 Data Base Organization and File Structure: Introduction 22 Chapter 1: Data Models  Many views, single conceptual (logical) schema and physical schema  External View: contains n view, each view schema describing view of one user  Conceptual View: describes structure of whole database for a community of users  Internal View: describes physical storage structure of database  Provides abstraction May 22, 2017 Data Base Organization and File Structure: Introduction 23 Chapter 1: Data Models  Mapping: required to map user’s request to conceptual to internal to stored database and then back after formatting it to suit the user’s view of database  Data Independence: Capacity to change the conceptual schema without having to change external schema or application programs  May 22, 2017 Applications insulated from how data is structured and stored Data Base Organization and File Structure: Introduction 24 Chapter 1: Data Models  Logical Data Independence: Protection from changes in logical structure of data  Physical Data Independence: Protection from changes in physical structure of data May 22, 2017 Data Base Organization and File Structure: Introduction 25 Chapter 1: Data Models  Physical Data Independence: Physical data independence – capacity to change the internal schema without having to change the conceptual (or external) schema  Change to reorganize physical files by creating additional access structures  Mapping information is stored in catalog  Disadvantages: Overhead when compiling or executing a query or program  inefficiency in DBMS May 22, 2017 Data Base Organization and File Structure: Introduction 26 Chapter 1: Data Models   Example: University Database Conceptual schema: Students(sid: string, name: string, login: string, age: integer, gpa:real) Courses(cid: string, cname:string, credits:integer) Enrolled(sid:string, cid:string, grade:string)   Physical schema:  Relations stored as unordered files  Index on first column of Students External Schema (View):  May 22, 2017 Course_info(cid:string,enrollment:integer) Data Base Organization and File Structure: Introduction 27 Chapter 1: DBMS Languages  DDL: can be used to define conceptual and internal schema in DBMS, where there is no strict separation  DDL is used to specify conceptual and SDL to specify internal where there is separation  VDL: is used to specify user views and their mapping to conceptual  VDL statements can be compiled separately or can be imbedded in a programming language May 22, 2017 Data Base Organization and File Structure: Introduction 28 Chapter 1: DBMS Languages  DML: is used for retrieval, insertion, deletion and modification of data   May 22, 2017 High level or non-procedural DML  Can be used to specify complex database operation  Called set-at-a-time or set oriented DML Low level or procedural DML  Embedded in a general-purpose programming language  Called record-at-a-time DML Data Base Organization and File Structure: Introduction 29 Chapter 1: DBMS Languages  DML: is declarative as it set what to retrieve and not how to retrieve   When DML is embedded in a programming language  DML is called data sub-language  Programming language is called host language DML standalone is called Query Language May 22, 2017 Data Base Organization and File Structure: Introduction 30 DBMS architecture    A typical DBMS has a layered architecture The figure does not show the concurrency control and recovery components This is one of several possible architectures; each system has its own variations May 22, 2017 (Slide from text book author) Query Optimization and Execution Relational Operators These layers must consider concurrency control and recovery Files and Access Methods Buffer Management Disk Space Management DB Data Base Organization and File Structure: Introduction 31 Chapter 1: Summary (Slide from text book author)  DBMS used to maintain, query large datasets.  Benefits include recovery from system crashes, concurrent access, quick application development, data integrity and security  Levels of abstraction give data independence  A DBMS typically has a layered architecture  DBAs hold responsible jobs and are well-paid  DBMS R&D is one of the broadest, most exciting areas in CS May 22, 2017 Data Base Organization and File Structure: Introduction 32
 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
									 
                                             
                                             
                                             
                                             
                                             
                                             
                                             
                                             
                                             
                                             
                                            