Presentation is loading. Please wait.

Presentation is loading. Please wait.

Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems.

Similar presentations


Presentation on theme: "Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems."— Presentation transcript:

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 System Concepts and Architecture)

2 Chapter 2: Database System Concepts and Architecture1 Outline Data Models Categories of Data Models Schemas,Instances, and Database State Three-Schema Architecture & Data Independence Database Languages DBMS Interfaces DBMS Component Modules Database System Utilities Tools, Application Environments, & Communication Facilities Client/Server DBMS Architecture Classification of Database Management Systems Reading: Chapter 2

3 2 Data Models A collection of concepts that can be used to describe the structure of a database. Provides the means to achieve data abstraction by hiding unneeded details of data storage. Most data models include a set of basic operations for specifying retrievals and updates on the database. Some data models include concepts for specifying the dynamic aspects or behavior of a database application. Data model examples: hierarchical model, network model, relational model, object oriented model. Chapter 2: Database System Concepts and Architecture Data types, relationships and constraints

4 Chapter 2: Database System Concepts and Architecture3 Categories of Data Models Data models can be categorized according to the types of concepts they use to describe the database structure: Conceptual (High-level, semantic) data models: Provide concepts close to the way users perceive data. Physical (Low-level, internal) data models: Provide concepts that describe the 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.

5 Chapter 2: Database System Concepts and Architecture4 Categories of Data Models Conceptual data models use concepts such as entities, attributes and relationships. An entity represents a real-world object or concept such as an employee or a project. An attribute represents some property of interest that further describes an entity such as the employee’s name or salary. A relationship among two or more entities represents an association among two or more entities such as a works-on relationship between an employee and a project.

6 Chapter 2: Database System Concepts and Architecture5 Categories of Data Models Physical data models describe how data is stored in the computer by representing information such as record formats, record ordering, and access paths. Implementation data model: The most frequently used model in traditional commercial DBMSs. Includes the widely used relational data model, as well as the network, and the hierarchical models. Represents data by using record structures.

7 6 Schemas, Instances, and Database State It is important to distinguish between the description of a database and the database itself. The description of a database is called the database schema, which is specified during database design and is not expected to change frequently. A displayed schema is called a schema diagram. Each object in the schema is called a schema construct. Schema diagram does not display the actual instances of records. Chapter 2: Database System Concepts and Architecture NameStudentNumberClassMajor CourseNameCourseNumberCreditHoursDepartment STUDENT COURSE

8 Schemas, Instances, and Database State The data in a database at a particular moment is called the database state or the database instance. STUDENT Every time we insert or delete a record we change the state of a database. The schema change is called schema evolution. 7Chapter 2: Database System Concepts and Architecture NameStudentNumberClassMajor Smith171CS Brown82CS

9 Chapter 2: Database System Concepts and Architecture Three-Schema Architecture & Data Independence A three schema architecture is an architecture that is proposed to help in achieving & visualizing the following three important characteristics: Program-data independence. Support of multiple user views. Use of catalog to store the data description. 8

10 Chapter 2: Database System Concepts and Architecture The Three-Schema Architecture Schemas can be defined at the following three levels: The internal level internal schema Describes the physical storage of the database (e.g. indexes). Uses a physical data model. The conceptual level conceptual schema Describes the structure of the whole database for users. Hides the details of physical storage structure. Concentrates on describing entities, data types, relationships, user operations, and constraints. Uses a conceptual or an implementation data model. The external (view) level # of external schemas/user views Each describes the part of the database that a particular user group is interested in and hides the rest. Uses the same data model as the conceptual level. 9

11 The Three-Schema Architecture END USERS EXTERNAL LEVEL... external/conceptual mapping CONCEPTUAL LEVEL conceptual/internal mapping INTERNAL LEVEL 10Chapter 2: Database System Concepts and Architecture External view External view Conceptual schema Internal schema STORED DATABASE

12 Chapter 2: Database System Concepts and Architecture Data Independence The capacity to change the schema at one level of a database system without having to change the schema at the next higher level. There are two types of independence: Logical data independence: The capacity to change the conceptual schema without having to change external schemas or application programs (expand or reduce). Physical data independence: The capacity to change the internal schema without having to change the conceptual schema or external schemas. The two levels of mappings create an overhead during execution of a query, leading to inefficiencies in the DBMS Few DBMS have implemented the full three-schema architecture. 11

13 Database Languages Data Definition Language (DDL) is used by the DBA and database designers to specify the conceptual schema of a database. In many DBMSs, the DDL is also used to define internal and external schemas (views). In some DBMS, separate Storage Definition Language (SDL) and View Definition Language (VDL) are used to define internal and external schemas. 12Chapter 2: Database System Concepts and Architecture

14 Database Languages Once the database is populated with data a Data Manipulation Language (DML) is used to manipulate data. In current DBMSs, the preceding types of languages are usually not considered distinct languages; rather a comprehensive integrated language is used. The Structured Query Language (SQL) is a typical example of comprehensive relational database language. 13

15 Chapter 2: Database System Concepts and Architecture DBMS Interfaces Stand alone query language interface. Programmer interfaces for embedding DML in programming languages. User friendly interfaces provided by DBMS may include the following: Menu-Based interfaces for web clients or browsing: Present the user with lists of options, called menus, that lead the user through the formulation of a request. Forms-based interfaces: Users can fill out some of the form entries and the DBMS will retrieve matching data for the remaining entries. 14

16 Chapter 2: Database System Concepts and Architecture DBMS Interfaces Graphical user interfaces: Displays a schema to the user in a diagrammatic form. The user can then specify a query by manipulating the diagram. Natural language interfaces: These interfaces accept requests written in English. Speech Input and Output: Limited use of speech as an input query and speech as an answer to a question or result of a request is becoming commonplace. Interfaces for parametric users: Repeated work. Interfaces for the DBAs: Privileged commands. 15

17 Chapter 2: Database System Concepts and Architecture DBMS Component Modules The database and DBMS catalog are usually stored on disk. Access to the disk is controlled by the operating system (OS). A higher-level, stored data manager module (component) controls access to DBMS information that is stored on disk. The DDL compiler processes schema definitions, specified in the DDL, and stores descriptions of schemas in the DBMS catalog which include information such as table names, data items, mapping into many schemas and constraints. The query compiler handles high-level queries that are entered interactively. 16

18 Chapter 2: Database System Concepts and Architecture DBMS Component Modules The query optimizer is concerned with rearrangement and possible reordering of operations, elimination of redundancies, and use of correct algorithms and indexes during execution. The precompiler extracts DML commands from an application program written in a host programming language. These commands are sent to the DML compiler for compilation into object code for database access. The rest of the program is sent to the host language compiler. The runtime database processor handles database access at runtime; it receives retrieval or update operations and carries them out on the database. 17

19 Chapter 2: Database System Concepts and Architecture Component Modules of a DBMS & Their Interactions 18 Stored database Stored data manager Concurrency control/ backup/recovery subsystems Runtime database processor Query compiler DML compiler DDL compiler Host language compiler Privileged commands DDL statements Interactive query Application programs Precompiler System catalog/ data dictionary Compiled transactions DBA Commands, Queries, and Transactions DBA staffCausal usersParametric usersApplication programmers Query Optimizer Input/Output from Database

20 Chapter 2: Database System Concepts and Architecture Database System Utilities Most DBMSs have database utilities that help the DBA in managing the database: Loading: Used to load existing data files into the database (e.g. Text files). The source & target structure are specified to the utility which reformats & stores data. Backup: Backup copy of the database, usually by dumping the entire data onto tape. It can then be used to restore data in case of disaster. Database storage reorganization: Reorganize a set of database files into a different file organization to improve performance. 19

21 Chapter 2: Database System Concepts and Architecture Database System Utilities Performance monitoring: Monitors database usage and provides statistics for decision making. Sorting files. Handling data compression. Monitoring access by users. Interfacing with the network. 20

22 Chapter 2: Database System Concepts and Architecture Tools, Application Environments, & Communication Facilities Tools available to database designers, users, and DBAs include: CASE tools which are used in the design phase. Data dictionary (data repository) to store catalog information and others such as design decisions, usage standards, application program descriptions, and user information. Application development environments: PowerBuilder designer...etc are becoming quite popular because of their features in database design, GUI development, querying & updating, and application program development. Communication facilities: Communications software, which allows users to access remote databases. 21

23 Chapter 2: Database System Concepts and Architecture Client/Server DBMS Architecture The architecture of DBMS packages has evolved. DBMS software package was one tightly integrated system DBMS software packages became modular in design, with a client/server system architecture Large centralized mainframe computers Hundreds of distributed workstations & PCs connected via communications networks to various types of server machines 22

24 Chapter 2: Database System Concepts and Architecture Client/Server DBMS Architecture In a basic client/server DBMS architecture: The system functionality is distributed between two types of modules. A client module is typically designed so that it will run on a user workstation or PC. Application programs and user interfaces that access the database run in the client module. A server module handles data storage, Access, search, and other functions. 23

25 Chapter 2: Database System Concepts and Architecture Classification of Database Management Systems Several criteria are used to classify DBMSs: Data model on which DBMS is based. Two types are currently used, the relational data model and the object oriented model. Number of users supported by the system. Singular systems and multi-user systems Number of sites over which the database is distributed. A DBMS is centralized if the data is stored at a single computer site. A distributed DBMS (DDBMS) can have actual database and DBMS at multiple sites. The cost of the DBMS. The type of access path for storing files. General purpose or special purpose. 24


Download ppt "Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems."

Similar presentations


Ads by Google