Lection №4 Development of the Relational Databases.

Post on 18-Jan-2016

224 views 0 download

Tags:

transcript

Lection №4Lection №4

Development of the Relational Databases

Main QuestionsMain Questions

Database introduction.Development of the Relational

Databases.

1.Database introduction1.Database introduction

Definition of the databaseTypes of DatabasesDatabase Models

1.0.Repeat - IS1.0.Repeat - ISAn Information System (IS)Information System (IS) is the system of

persons, data records and activities that process the data and information in a given organization, including manual processes or automated processes;

The computer-based information systems is only the Information technologies Information technologies componentcomponent of an Information SystemInformation System;

The computer-based information systems are the field of study for Information Information technologies (IT) technologies (IT)

1.0.Repeat - HIS1.0.Repeat - HIS

The aim of an HIS is to achieve the best possible support of patient care and administration by electronic data electronic data processingprocessing:

more efficient use of the restricted resources available for patient care;

qualitative improvement of the service to the patient;

support of research;support of teaching;

1.0.Repeat - HIS1.0.Repeat - HIS

Databases

1.0.Repeat - HIS1.0.Repeat - HIS

Databases

1.1.Definition of the database1.1.Definition of the databaseBriefBrief. DatabaseDatabase is a computerized record

keeping system.FullFull. DatabaseDatabase is a system involving datadata,

the hardwarehardware that physically stores that data, the softwaresoftware that utilizes the hardware's file system in order to 1) store the data and 2) provide a standardized method for retrieving or changing the data, and finally, the usersusers who turn the data into information

1.2.Types of Databases1.2.Types of DatabasesAnalytic databases (OLAP- On Line Analytic databases (OLAP- On Line

Analytical Processing)Analytical Processing) are primarily static, read-only databases which store archived, historical data used for analysis.

Operational databases (OLTP On Line Operational databases (OLTP On Line Transaction Processing),Transaction Processing), are used to manage more dynamic bits of data. This databases allow you to modify that data (add, change or delete data). These types of databases are usually used to track real-time information.

1.3. Database Models1.3. Database Models

Hierarchical DatabasesHierarchical Databases - defines hierarchically-arranged data.

Network DatabasesNetwork Databases - use set theory to provide a tree-like hierarchy with the exception that child tables were allowed to have more than one parent .

Relational DatabasesRelational Databases - represents data in the form of two-dimension tables.

1.3.1.1.3.1.Hierarchical DatabasesHierarchical Databases This type of relationship can be visualized as

upside down tree of datatree of data. In this tree, a single table acts as the "rootroot" of the database from which other tables "branchbranch" out.

PProblem roblem 1.1. User cannot add a record to a child table until it has already been incorporated into the parent table .

PProblemroblem 2.2. RedundancyRedundancy would occur because hierarchical databases handle one-to-many relationships well but do not handle many-to-many relationships well

Hierarchical DatabasesHierarchical Databases Structure Structure

Redundancy in Redundancy in the hierarchical the hierarchical databasedatabase

1.3.2.1.3.2.Network DatabasesNetwork Databases ІМ ІМ Is very similar to the hierarchical model

actually. In fact, the hierarchical modelhierarchical model is a subsetsubset of the network modelnetwork model. However, instead of using a single-parent tree hierarchy, this model uses set theory to provide a tree-like hierarchy with the exception that child tables were allowed to have more than one parent. This allowed the network model to support many-to-many many-to-many relationshipsrelationships.

Problem. This model was difficult to implement and maintain

Network DatabasesNetwork Databases Structure Structure

1.3.3.1.3.3.Relational DatabasesRelational Databases

Was formally introduced by Dr. E. F. CoddDr. E. F. Codd in 19701970 and has evolved since then:

Represents data in the form of two-dimension tables.

Each table represents some real-world person, place, thing, or event about which information is collected.

Two or more tables can be linked by relationshiprelationship.

2. Development of the 2. Development of the Relational DatabasesRelational Databases

Overview of the Relational Model Data Structure and Terminology Properties of Relational Tables Relationships and Keys Data Integrity Normalization DBMS

2.1.Relational Model Overview2.1.Relational Model Overview

The relational modelrelational model represents data in the form of two-dimension tablestwo-dimension tables.

The organization of data into relational tables is known as the logical viewlogical view of the database. That is, the form in which a relational database presents data to the user and the programmer. .

The way the database software physically stores the data on a computer disk system is called the internal viewinternal view. The internal view differs from product to product.

2.2.Data Structure and Terminology2.2.Data Structure and Terminology A databasedatabase is a collection of relational tablesrelational tables. A relational tablerelational table is a flat file composed of a set

of named columnscolumns and an arbitrary number of unnamed rows rows.

A data valuedata value is stored in the intersection of a row and column.

The columnscolumns of the tables contain information about the table. The rowsrows of the table represent occurrences of the "thing" represented by the table.

2.2.1. Terminology2.2.1. Terminology

In This In This DocumentDocument

Formal TermsFormal TermsMany Database Many Database

ManualsManuals

Relational Table Relation Table

Column Attribute Field

Row Tuple Record

2.3. Properties of Relational 2.3. Properties of Relational TablesTables Values are atomic. Column values are of the same kind. Each row is unique. The sequence of columns is

insignificant. The sequence of rows is insignificant. Each column must have a unique name.

2.3.1. Properties of Relational 2.3.1. Properties of Relational TablesTables Values are atomicValues are atomic - columns in a

relational table are not repeating group or arrays. Such tables are referred to as being in the "first normal form" (1NF) .

Column values are of the same kindColumn values are of the same kind. In relational terms this means that all values in a column come from the same domain. A domain is a set of values which a column may have.

2.3.2. Properties of Relational 2.3.2. Properties of Relational TablesTables

Each row is uniqueEach row is unique. This property ensures that no two rows in a relational table are identical; there is at least one column, or set of columns, the values of which uniquely identify each row in the table.

The sequence of columns is insignificant.The sequence of columns is insignificant. This property states that the ordering of the columns in the relational table has no meaning. Columns can be retrieved in any order and in various sequences.

2.3.3. Properties of Relational 2.3.3. Properties of Relational TablesTables The Sequence of Rows is The Sequence of Rows is

InsignificantInsignificant. The rows of a relational table can be retrieved in different order and sequences.

Each Column Has a Unique NameEach Column Has a Unique Name.. Because the sequence of columns is insignificant, columns must be referenced by name and not by position.

2.4. Relationships and Keys2.4. Relationships and Keys A relationshiprelationship is an association between two or

more tables. Relationships are expressed in the data values of the primaryprimary and foreign keysforeign keys .

A primary keyprimary key is a column or columns in a table whose values uniquely identify each row in a table Визначити ключові атрибути.

A foreign keyforeign key is a column or columns whose values are the same as the primary key of another table.

The relationship is made between two relational tables by matching the values of the foreign key in one table with the values of the primary key in another.

2.4.1. Relationships Type2.4.1. Relationships Type A one-to-one (1:1)one-to-one (1:1) relationship is when at most one

instance of a entity A is associated with one instance of entity B.

2.4.2. Relationships Type2.4.2. Relationships Type A one-to-many (1:N)one-to-many (1:N) relationships is when for one

instance of entity A, there are zero, one, or many instances of entity B, but for one instance of entity B, there is only one instance of entity A.

2.4.3. Relationships Type2.4.3. Relationships Type A many-to-many (M:N)many-to-many (M:N) relationship (non-specific)

is when for one instance of entity A, there are zero, one, or many instances of entity B and for one instance of entity B there are zero, one, or many instances of entity A .

2.5. 2.5. Data IntegrityData Integrity Data integrity means, in part, that you can correctly

and consistently navigate and manipulate the tables in the database.

The entity integrity rule states that the value of the primary key can never be a null value (and should never be unknown).

The referential integrityreferential integrity rule states that if a relational table has a foreign key, then every value of the foreign key must either be null or match the values in the relational table in which that foreign key is a primary key

2.6. 2.6. NormalizationNormalization Basics. Basics.The goal of normalizationgoal of normalization is to create a set

of relational tables that are free of redundant data and that can be consistently and correctly modified. .

Normalization theoryNormalization theory is based on the concepts of normal formsnormal forms.. There are currently fivefive normal forms that have been defined.

Normalization is essentially a two step process that puts data into tabular form by removing repeating groups and then removes duplicated data from the relational tables.

2.6. 2.6. NormalizationNormalization. 1NF. 1NF A relational table, by definition, is in first normal first normal

formform (1NF) (1NF). All values of the columns are atomic. That is, they contain no repeating values. Table in 1NF it contains redundant data

2.6. 2.6. NormalizationNormalization. 2NF. 2NFA relational table is in second normal form second normal form

((2NF2NF)) if it is in 1NF and every non-key column is fully dependent upon the primary key.

2.6. 2.6. NormalizationNormalization. 3NF. 3NF A relational table is in third normal form (3NF)third normal form (3NF) if it is

already in 2NF and every non-key column is non transitively dependent upon its primary key. In other words, all nonkey attributes are functionally dependent only upon the primary key.

2.7. DBMS.2.7. DBMS.A database management system database management system

(DBMS)(DBMS) is a software package with computer programs that control the creation, maintenance, and use of a database.

It allows organizations to conveniently develop databases for various applications by database database administrators (DBAs)administrators (DBAs) and other specialists.

ConclusionConclusion

In this lecture was described next questions:

Database introduction.Development of the Relational

Databases.

LiteratureLiterature

Electronic documentation into the intranet section of the TDMU web-server:http://www.tdmu.edu.te.uahttp://www.tdmu.edu.te.ua