Chapter 1&2



NOTES - PART I

Databases and Database Management Systems

Based on Chapters 1-2 in

Fundamentals of Databse Systems by Elmasri and Navathe, Ed. 5)

[pic]

[pic]

[pic]

1. Basic Definitions

Database: A collection of related data that has the following implicit properties:

1. Represents some aspect of the real world

2. Logically cohernet collection of data with

some inherent meaning

3. Designed, built, and populated with data for a

specific purpose

4. Can be of any size and complexity

Data: Known facts that can be recorded and have an implicit meaning.

Database Management System (DBMS): A software package/ system to facilitate the creation and maintenance of a computerized database.

The DBMS is a general-purpose software system that facilitates the process of defining, constructing, manipulating, and sharing data among users and applications.

Defining a database involves specifying the data types, structures, and constraints for data. The descriptive information about what is stored in the database forms what is called meta-data: data that describes data.

Constructing is the storing of data.

Manipulating is the retrieval and updating of data.

Sharing is between multiple users and/or programs concurrently.

Other functions include 1) system protection against hardware and software failures, 2) security protection against unauthorized access, and 3) evolution of data requirements.

Database System: The DBMS software together with the data itself. Sometimes, the applications are also included.

1.2. Example of a Database

INSERT MS Access Example Here

1.3 Characteristics of Database Approach

1 Self-describing nature of a database system: A DBMS catalog stores the description of the database. The description is called meta-data). This allows the DBMS software to work with different databases.

2 Insulation between programs and data: Called program-data independence. Allows changing data storage structures and operations without having to change the DBMS access programs.

In object-oriented model, users can define operations on data. These operations (methods) have an interface which includes the operation name and parameters. The implementation (of the method) can be changed without affecting the interface. This is program-operation independence.

Data Abstraction: A data model is used to hide storage details and present the users with a conceptual view of the database. In other words, this allows the program data independence and program operation independence.

A data model (definition found in chapter 2) is a collection of concepts and basic operations that can be used to describe the structure of a database, and certain constraints that the database should obey.

3 Support of multiple views of the data: Each user may see a different view of the database, which describes only the data of interest to that user.

4 Concurrency Control: A multiuser DBMS must allow multiple users to access the database at the same time and ensure that users trying to update the same data do so in a controlled manner so that the results is correct. The concept of a transaction is central to the accessing of data in a database. A transaction is an atomic unit of work performed on the database. This work may be reading, writing, updating, inserting, deleting, etc. The transaction is to be performed as though it was executed in isolation.

1.4. Actors (users) on the Scene

1. DBA-- database administrator is responsible for authorizing access to the database, for coordinating and monitoring its use, and for acquiring software and hardware resources as needed.

2. Database Designers are responsible for identifying the data to be stored in the database and for choosing appropriate structures to represent and store this data.

3. End Users

a. casual

b. naïve

c. sophisticated

d. stand-alone

4. Software Engineers

a. system analysts determine the requirement of end users and develop specifications for transactions to meet their needs.

b. application programmers implement these specifications as programs.

5. workers behind the scene

a. DBMS system designers and implementers

b. tool developers

c. operators and maintenance personnel

1.6 Additional Advantages of Using DBMS

1 Controlling redundancy in data storage and in development and maintenence efforts.

2 Restricting unauthorized access to data.

3 Providing Persistent storage for program objects and data structures

4 Efficient Query Processing

5 Providing backup and recovery systems

6 Providing multiple interfaces to different classes of users.

7 Representing complex relationships among data.

8 Enforcing integrity constraints on the database.

9 Permitting Inferencing and actions using rules. Typical actions are performed by triggers and stored procedures.

10 Potential for enforcing standards.

11 Reduced application development time.

12 Flexibility to change data structures.

13 Availability of up-to-date information.

14 Economies of scale and sharing of data among multiple users.

1.7 Brief History of database

HISTORY OF DATA MODELS

[pic]

[pic]

[pic]•

[pic]

[pic]

[pic]

[pic]

[pic]

[pic]

[pic]

• E-commerce: Extraction and insertion of data from/into a database dynamically via web access. eXtended Markup Language (XML) is the primary standard for interchanging data among various types of databases and web pages.

• XML databases: An evolution from the usage of web pages and the transmission of data between different entities has led to the storage and retrievial of XML documents in databases. In some cases this is native and in others an adaptive hybrid.

1.8 When not to use a DBMS

Main inhibitors (costs) of using a DBMS:

- High initial investment and possible need for additional hardware and/or personnel

- Overhead for providing generality, security, recovery, integrity, and concurrency control.

When a DBMS may be unnecessary:

- If the database and applications are simple, well defined, and not expected to change.

- If there are stringent real-time requirements that may not be met because of DBMS overhead.

- If access to data by multiple users is not required.

When no DBMS may suffice:

- If the database system is not able to handle the complexity of data because of modeling limitations

- If the database users need special operations not supported by the DBMS.

Chapter 2

[pic]

2.1 Data Models

A data model is a collection of concepts and basic operations that can be used to describe the structure of a database, and certain constraints that the database should obey.

Data Model Operations: Operations for specifying database retrievals and updates by referring to the concepts of the data model.

2.1.1 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.

- representational data models: Provide concepts that fall between the above two, balancing user views with some computer storage details.

Entity-- represnets a real-world object or concept

Attribute -- represnets some property of interest that further describes an entity

Relationship (between entities) -- represents an interaction among entities

Traditional representational data models used: relational, network, and hierarchical … these are record-based

Newer model closer to conceptual model … object

2.1.2 Schemas and Instances

Database Schema: The description of a database. Includes descriptions of the database structure and the constraints that should hold on the database.

Schema Diagram: A diagrammatic display of (some aspects of) a database schema.

Database Instance: The actual data stored in a database at a particular moment in time . Also called database state (or occurrence).

The database schema changes very infrequently . The database state changes every time the database is updated . Schema is also called intension, whereas state is called extension.

[pic]

2.2.1 Three-Schema Architecture

Proposed to support DBMS characteristics of:

- Program-data independence.

- Support of multiple views of the data.

Defines DBMS schemas at three levels :

- Internal schema at the internal level to describe data storage structures and access paths. Typically uses a physical data model.

- Conceptual schema at the conceptual level to describe the structure and constraints for the whole database. Uses a conceptual or an implementation data model.

- External schemas at the external level to describe the various user views. Usually uses the same data model as the conceptual level.

Mappings among schema levels are also needed. Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution.

[pic]

2.2.2 Data Independence

Logical Data Independence: The capacity to change the conceptual schema without having to change the external schemas and their application programs.

Physical Data Independence: The capacity to change the internal schema without having to change the conceptual schema.

When a schema at a lower level is changed, only the mappings between this schema and higher-level schemas need to be changed in a DBMS that fully supports data independence. The higher-level schemas themselves are unchanged. Hence, the application programs need not be changed since the refer to the external schemas.

2.3.1 DBMS Languages

Data Definition Language (DDL): 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 DBMSs, separate storage definition language (SDL) and view definition language (VDL) are used to define internal and external schemas.

Data Manipulation Language (DML): Used to specify database retrievals and updates. Two types: high level nonprocedural and low level procedural

Low Level Procedural

- DML commands (data sublanguage) can be embedded in a general-purpose programming language (host language), such as C++, Java, COBOL, …

- DML commands (data sublanguage) embedded in a proprietary vendor specific language

High Level Non-Procedural

- Alternatively, stand-alone DML commands can be applied directly (query language) ex. SQL

2.3.2 DBMS Interfaces

- User-friendly interfaces:

- Menu-Based Interfaces for Web Clients or Browsing

- Forms-based

- Graphics-based (Point and Click, Drag and Drop etc.)

- Natural language

- Parametric interfaces using function keys.

- Interfaces for the DBA:

- Creating accounts, granting authorizations

- Setting system parameters

- Changing schemas or access path

- Speech as Input and Output

- Stand-alone query language interfaces.

- Programmer interfaces for embedding DML in programming languages:

- Pre-compiler Approach

- Procedure (Subroutine) Call Approach

- Report generation languages.

insert Figure 2.3………

2.5 Architectures of DBMS

2.5.1 Centralized

2.5.2 Basic Client/Server

2.5.3 Two-Tier Client/Server

ODBC ( Open Database Connectivity) provides an API.

[pic]

2.5.4 Three-Tier Client/Server

Client, Application/Web Server, Database Server

[pic]

2.6. Classification of DBMSs

First classification: Based on the data model used:

- Traditional: Relational, Network, Hierarchical.

- Emerging: Object-oriented, Object-relational.

Second classification:

- Single-user (typically used with micro- computers) vs. multi-user (most DBMSs).

Third classification:

- Centralized (uses a single computer with one database)

- Distributed (uses multiple computers, multiple databases)

- homogenous (loosely coupled systems using the same DBMS software

- heterogeneous (loosely coupled systems using different pre-existing DBMS). Also called federated DBMS

..note…..Distributed Database Systems have now come to be known as client server based database systems because they do not support a totally distributed environment, but rather a set of database servers supporting a set of clients.

Fourth classification: cost

Fifth: type of access path (indexing and storage of data)

Sixth: general or special purpose

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download