Database System Concepts and Architecture Lecture # 2 21 June 2012 National University of Computer and Emerging Sciences.

Slides:



Advertisements
Similar presentations
Database System Concepts and Architecture
Advertisements

Chapter 2 Database System Concepts and Architecture
Database Systems Chapter 2
Chapter 2 Database Environment.
1 Chapter 2 Database System Concepts and Architecture.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 2- 1.
ICS (072)Database Systems Background Review 1 Database Systems Background Review Dr. Muhammad Shafique.
Chapter 2 Database Environment Pearson Education © 2014.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Overview of Database Languages and Architectures.
Lecture Two Database Environment Based on Chapter Two of this book:
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 2 Database System Concepts and Architecture.
Centralized and Client/Server Architecture and Classification of DBMS
Database System Concepts and Architecture Dr. Ali Obaidi.
1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.
Chapter 2 Database System Concepts and Architecture
Copyright © 2004 Pearson Education, Inc. Chapter 1 Introduction.
Database Environment 1.  Purpose of three-level database architecture.  Contents of external, conceptual, and internal levels.  Purpose of external/conceptual.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 2 Database System Concepts and Architecture.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 1 Database System Architecture.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 2 Database System Concepts and Architecture.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1 Chapter 2: Database System Concepts and Architecture - Outline Data Models and Their.
Slide Chapter 2 Database System Concepts and Architecture.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 2- 1.
Database System Concepts and Architecture
Copyright © 2004 Pearson Education, Inc.. Chapter 2 Database System Concepts and Architecture.
Faculty of Information Science and Technology Mahanakorn University of Technology Topic 2 Database System Concepts and Architecture.
CSC271 Database Systems Lecture # 4.
CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single.
2. Database System Concepts and Architecture
1 CSBP430 – Database Systems Chapter 2: Database System Concepts and Architecture Elarbi Badidi College of Information Technology United Arab Emirates.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 2 Database System Concepts and Architecture.
Instructors: Churee Techawut Introduction to Database System Chapter 1 CS (204)321 Database System I.
Database System Concepts and Architecture. Relational Model Concepts relational model represents the database as a collection of relations. Each relation.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 2- 1.
Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 2-1 Data Models Data Model: A set.
Chapter 2 Database System Concepts and Architecture Dr. Bernard Chen Ph.D. University of Central Arkansas.
1Mr.Mohammed Abu Roqyah. Database System Concepts and Architecture 2Mr.Mohammed Abu Roqyah.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Database System Concepts and Architecture
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 2- 1.
DBMS_Week 3-4 DBMS. Three-Schema Architecture – Internal schema (one view) describes physical storage structures access paths, indexes used Typically.
DataBase System Concepts and Architecture
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 2- 1.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.
Chapter 2 Database Environment.
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Introduction: Databases and Database Systems Lecture # 1 June 19,2012 National University of Computer and Emerging Sciences.
Database Systems 主講人 : 陳建源 日期 :99/9/14 研究室 : 法 Chapter 2 Database System Concepts and Architecture.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 2- 1.
Chapter 2 Database System Concepts and Architecture ICS (081)1.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe Chapter 2 Database System Concepts and Architecture.
Chapter 2 Database System Concepts and Architecture Dr. Abdalla AlAmeen.
College of Arts & Science Computer Science Department
Databases (CS507) CHAPTER 2.
Databases and DBMSs Todd S. Bacastow January 2005.
Chapter 2: Database System Concepts and Architecture - Outline
Chapter 2 Database System Concepts and Architecture
Database System Concepts and Architecture
Database System Concepts and Architecture
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Chapter 2: Database System Concepts and Architecture
Data, Databases, and DBMSs
Database System Concepts and Architecture
Presentation transcript:

Database System Concepts and Architecture Lecture # 2 21 June 2012 National University of Computer and Emerging Sciences

Data Models A set of concepts to describe the structure of a database. – The structure includes data types, relationships and constraints. Data Model Operations – Operations for specifying database retrievals and updates by referring to the concepts of the data model. – Data model may include basic operations and user-defined operations

Database Schemas Database Schema – The description of a database using the given data model. – 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 Schema Diagram – An illustrative display of a database schema. Schema Construct – A component of the schema or an object within the schema, e.g., STUDENT, COURSE.

Data Model and Schema 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.

Example of a Database Schema

Database State – Refers to the content of a database at a moment in time. – Also called database instance or occurrence. – Analogous to the value of a variable Initial State Refers to the database state when it is initially loaded into the system. Valid State – A state that satisfies the structure and constraints of the database

Example of a database state

Schemas versus State Schema changes very infrequently, whereas state changes every time the database is updated. Schema is also called intension, whereas state is called extension. Database Schema Database State

Categories of Data Models Conceptual (high-level, semantic) data models – Provide concepts that are close to the way many users perceive data. Also called entity-based or object-based data models. Physical (low-level, internal) data models – Provide concepts that describe details of how data is stored in the computer. Implementation (representational) data models – Provide concepts that fall between the above two, balancing user views with some computer storage details. It includes relational data model.

Entity-Relationship Model Example of schema in the entity-relationship model

Relational Data Model A Sample Relational Database

Three-Schema Architecture Proposed to support DBMS characteristics of: – Insulation of programs and data Program data independence Program operation independence – Support of multiple views of the data. – Use of catalog to store schema

Three-Schema Architecture Defines DBMS schemas at three levels: – Internal schema describes physical storage structures and access paths. Typically uses a physical data model. – Conceptual schema describes the structure and constraints for the database for a community of users. Uses a conceptual or an implementation data model. – External schemas describes the various user views. Usually uses the same data model as the conceptual schema.

Three-Schema Architecture

Mappings among schema levels are needed to transform requests and data. – Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution. – Data extracted from the internal DBMS level is reformatted to match the user’s external view (e.g. formatting the results of an SQL query for display in a Web page)

Data Independence Logical Data Independence – The capacity to change the conceptual schema without having to change the external schemas and their associated application programs. (Only the mappings need to be changed in DBMS) Physical Data Independence – The capacity to change the internal schema without having to change the conceptual schema. – For example, the internal schema may be changed when certain file structures are reorganized or new indexes are created to improve database performance  One of the most important benefits of using a DBMS!

DBMS Languages Data Definition Language (DDL) Data Manipulation Language (DML)

DBMS Languages Data Definition Language (DDL): – Used by the DBA and database designers to specify the conceptual schema of a database. – Specification (notation) for defining the database schema. E.g. create table account ( account-number char(10), balance integer) – Storage definition language (SDL) is used to specify internal schema. – View definition language (VDL) is used to define views and their mapping to conceptual schema. Slide 2- 18

DBMS Languages Data Manipulation Language (DML) – Used to specify database retrievals and updates Two classes of languages – Procedural (Low Level ) user specifies what data is required and how to get those data These must be embedded in a programming language – Nonprocedural (High Level ) user specifies what data is required without specifying how to get those data May be used in a standalone way(query language) or may be embedded in a programming language (host language) Slide 2- 19

DBMS Interfaces Stand-alone query language interfaces – Example: Entering SQL queries at the DBMS interactive SQL interface (e.g. SQL*Plus in ORACLE) Programmer interfaces for embedding DML in programming languages User-friendly interfaces such as – Menu-based, forms-based, graphics-based, etc. Slide 2- 20

Database System Utilities To perform certain functions such as: – Loading data stored in existing files into a database. Includes data conversion tools. – Backing up the database periodically on tape. – Reorganizing database file structures. – Report generation utilities. – Performance monitoring utilities. – Other functions, such as sorting, user monitoring, data compression, etc. Slide 2- 21

Data dictionary / repository – Used to store schema descriptions and other information such as design decisions, application program descriptions, user information, usage standards, etc. – Active data dictionary is accessed by DBMS software and users/DBA. – Passive data dictionary is accessed by users/DBA only. Slide 2- 22

Typical DBMS Component Modules Slide 2- 23

DBMS Architectures Centralized DBMS – Combines everything into single system including- DBMS software, hardware, application programs, and user interface processing software. – User can connect through a remote terminal. Slide 2- 24

Basic 2-tier Client-Server Architectures Client – a user machine with user interface capabilities and local processing. – It can access the specialized servers as needed Server – contains both hardware and software that provide services to clients, such as printing, file access, or database access Slide 2- 25

DBMS Server Provides database query and transaction services to the clients Relational DBMS servers are often called SQL servers, query servers, or transaction servers Applications running on clients utilize an Application Program Interface (API) to access server databases via standard interface such as: – ODBC: Open Database Connectivity standard – JDBC: for Java programming access Slide 2- 26

Two Tier Client-Server Architecture A client program may connect to several DBMSs, sometimes called the data sources. In general, data sources can be files or other non-DBMS software that manages data. Other variations of clients are possible: e.g., in some object DBMSs, more functionality is transferred to clients including data dictionary functions, optimization and recovery across multiple servers, etc. Slide 2- 27

Three Tier Client-Server Architecture Adds Intermediate layer called Application Server or Web Server. Middle Tier stores business logic that is use to access data from the database server Enhance security as DB server is only accessible via middle tier Slide 2- 28

Classification of DBMSs Based on the data model used – Traditional: Relational, Network, Hierarchical. – Emerging: Object-oriented, Object-relational. Single-user (typically used with personal computers) vs. multi-user (most DBMSs). Centralized (uses a single computer with one database) vs. distributed (uses multiple computers, multiple databases) Slide 2- 29

Record-based Logical Models Describe data at the conceptual and view levels. Specify overall logical structure of the database Provide a higher-level description of the implementation. The database is structured in fixed-format records of several types. – Each record defines a fixed number of fields, or attributes. – Each field is usually of a fixed length (this simplifies the implementation). The three most widely-accepted models are – relational, – network, and – hierarchical.

Relational Model Data and relationships are represented by a set of tables. A tuple or row contains all the data of a single instance of the table. Each table has a number of columns with unique names Every tuple must have a unique identification or key based on the data.

Network Model Data are represented by collections of records. Relationships among data are represented by links. Organization is that of an arbitrary graph.

Hierarchical Model Similar to the network model. Organization of the records is as a collection of trees, rather than arbitrary graphs. The relational model does not use pointers or links, but relates records by the values they contain. This allows a formal mathematical foundation to be defined.

Object Data Model Defines database in terms of objects, their properties and operations. Objects with same structure and behavior belong to a class Classes are organized into hierarchies The operations of each class are specified as methods Internal parts of the object, the instance variables and method code, are not visible externally. Describe data at the conceptual and view levels. Allow one to specify data constraints explicitly.

Example: Object Data Model For example, consider an object representing a bank account. The object contains instance variables number and balance The object contains a method pay-interest which adds interest to the balance. Under most data models, changing the interest rate entails changing code in application programs. In the object-oriented model, this only entails a change within the pay-interest method.

Distributed DBMSs (DDBMSs) Distributed Database Systems can have database and DBMS software distributed over many Homogeneous DDBMS Heterogeneous DDBMS Federated or Multidatabase Systems Uses client-server architecture Slide 2- 36