by: m.nadeem akhtar1 the data base management system (dbms) ch # 09

24
By: M.Nadeem Akhtar 1 The Data Base Management System (DBMS) Ch # 09

Upload: annabel-mcdowell

Post on 11-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

By: M.Nadeem Akhtar 1

The Data Base Management System

(DBMS) Ch # 09

By: M.Nadeem Akhtar 2

DBMS ?

A Data base management system (DBMS) is a software application that stores the structure of the data base, the data itself, relationships among data in the data base as well as forms and reports pertaining to the data base.

By: M.Nadeem Akhtar 3

DBMS?

Data Field: A data field is the smallest unit of data. An example is an

employee number

Record: A record is a collection of related data fields , such as an

employee record.File: A file is collection of related records such as an employee

file.Folder : A folder is a collection of related files and is conceptually

similar to a branch of a tree.

By: M.Nadeem Akhtar 4

Data Base structures :

1. HIERARCHICIAL DATA BASE STURCTURE.

2. NETWORK DATABASE STRUCTURES

3. RELATIONAL DATABASE STRUCTURES

By: M.Nadeem Akhtar 5

1-HIERARCHICIAL DATA BASE STURCTURE.

The first DBMS was IDS (Integrated Data Sore) and was developed by GE in 1964.

This data base influenced the work of committee on data system languages (CODASYL)

CODASYL formed a data base Task group and changed the group with the responsibility to develop the data base standards.

By: M.Nadeem Akhtar 6

HIERARCHICIAL DATA BASE STURCTURE.(CONTINUE)

The IDS database management systems conformed to a hierarchical database structure, in that the structure of the data groups, subgroups, and further subgroups looked like the branches of a tree.

Like branches on a tree, to get from a record on one branch to a record on different branch required the data base management system to navigate back to a common junction for the branches.

Sometimes the common junction was all the way back to the original trunk of the data-base tree structure.

By: M.Nadeem Akhtar 7

HIERARCHICIAL DATA BASE STURCTURE.(CONTINUE)

The hierarchical structure for databases was popular because it worked well with transaction processing systems (In computer science, transaction processing is information processing that is divided into individual, indivisible operations, called transactions. Each transaction must succeed or fail as a complete unit; it cannot remain in an intermediate state) that performed such tasks as order entry, accounts receivable, account payable, and similar accounting information applications.

Accounting tasks such as these were among the first business operations to be computerized.

Hierarchical structure utilizes computer resources efficiently when the large majority of records in the databases are to be used in the application.

The organization wants all customers to get a bill, all vendors to be paid, and all orders to be processed.

By: M.Nadeem Akhtar 8

HIERARCHICIAL DATA BASE STURCTURE.(CONTINUE)

When managers want only a few selected records from the large amount of data in the database the hierarchical structure is not as efficient.

Hierarchical database records have a field that locates the position (the storage address) of the next logical record in the database.

Records do not have to store physically one after the other on a storage device.

The location of the logically subsequent record is pointed to and the DBMS retrieves the next record.

By: M.Nadeem Akhtar 9

Example of Hierarchical data model

If an organization had records of employees in a table (entity type) called "Employees".

In the table there would be attributes/columns such as First Name, Last Name, Job Name and Wage.

The company also has data about the employee’s children in a separate table called "Children" with attributes such as First Name, Last Name, and DOB.

The Employee table represents a parent segment and the Children table represents a Child segment.

These two segments form a hierarchy where an employee may have many children, but each child may only have one parent.

By: M.Nadeem Akhtar 10

2-NETWORK DATABASE STRUCTURES

The Data Base Task Group subcommittee of CODASYL released its specification for the network database structures in 1971.

The network database structure allows a given record to point to any other record in the database.

The network model allows each record to have multiple parent and child records

Networks solved the problem of having to backtrack all the way to a joining branch of the database.

Conceptually, any record in the database could have a pointer to any other record in the database.

However, this wide range of possible connection was the weakness of applying network structures to practical problems.

It was just too chaotic/confusing to allow every record to point to every other record.

By: M.Nadeem Akhtar 11

By: M.Nadeem Akhtar 12

3-RELATIONAL DATABASE STRUCTURES

Business organizations never widely adopted DBMS built on the network structure.

Hierarchical database structure databases were sufficient and efficient for accounting operations but the languages for network DBMS seemed difficult for many programmers to master.

Organizations still wanted a way to address managerial problems using databases and that meant the need to focus on small subgroups of data and linking from one piece of data to another without having to navigate through a large number of intermediary data records.

By: M.Nadeem Akhtar 13

RELATIONAL DATABASE STRUCTURES(CONTINUE-)

C. J. Date and E. F. Codd both described a database structure based upon relational algebra.

Their work is closely associated with the relational database structure that is the most commonly used today by business organizations.

The database structure looks like a collection of tables. Relationships between the tables are not stored as explicit/

stated clearly in detail indexes or addresses; instead the relationships between tables are implicit/not plainly expressed.

When a common column between tables is the mechanism that establishes implicit relationships.

By: M.Nadeem Akhtar 14

RELATIONAL DATABASE STRUCTURES(CONTINUE-)

The conceptualization of a database structure that consists of tables where relationships are implicitly established by matching values in common columns is relatively easy to understand.

Ease of understanding is a key issue. . Managers and professional staff frequently are required to

access information directly from a database to support their decision making.

The table like structure of relational DBMS is a format that can be understood quickly by the manager and\or professional staff.

By: M.Nadeem Akhtar 15

A Relational Database Example

Assume that a student organization wants to help students sell their used books to other students who will need them for the next semester.

Two weeks before the end of the semester the student organization receives a list of the books that will be required for the next semester.

A member in the organization creates a table named BOOK in the database to contain the book name, the author(s) of the book, and the number of copies of that book required for the next semester.

Table 9.6 depicts the contents of the BOOK table.

By: M.Nadeem Akhtar 16

A Relational Database Example(continue)

By: M.Nadeem Akhtar 17

A Relational Database Example(continue)

One week before the end of semester, students are asked to list the books they have available to sell.

Table 9.7 shows the value for the student ID field, the last name field , first name, and book name, the student wish to sell.

The BOOK table is implicitly related to the STUDENT table through the common “Book Name” column.

Which students have “PERSONAL SALES TECHNIQUES” available for sale? You can see from the STUDENT table alone that students with IDs of 250,700, and 810 have the book to sell.

By: M.Nadeem Akhtar 18

Table 9.7

By: M.Nadeem Akhtar 19

A Relational Database Example(continue)

Who has a book to sell that was authored by McLeod & Schell? This question requires a relationship between BOOK and STUDENT.

In the BOOK table the author value of “Macleod and Shell” is in the same record where the Book Name data value is “Management Information System, 8th edition

The “Book Name” field is common column between the tables and matching the “Management Information System, 8th edition" value from BOOK to the records in STUDENT yields our answer.

Students 100,230,260,305,400,500,565,600 and 875 have the book to sell.

By: M.Nadeem Akhtar 20

A Relational Database Example(continue)

Each table has a field the value of which will uniquely identify each row of the table. If you know the data value of the BOOK NAME field in the BOOK table, then you will know exactly which record in the table is being read.

Knowing the “Book Name” data value in the STUDENT table will not uniquely identify the record. For the STUDENT table the student ID field (i.e., SID) uniquely identifies each record.

The database implementation of the fields in the tables and the relationship the two tables is shown in fig 9.4, 9.5, and 9.6.

Fig 9.7 Shows part of a database report, using Microsoft access, containing data from the BOOK and STUDENT tables.

By: M.Nadeem Akhtar 21

Fig 9.4(Description of BOOK table using MS Access.)

By: M.Nadeem Akhtar 22

Fig 9.5 (Description of Student Table)

By: M.Nadeem Akhtar 23

Fig 9.6 (Relationship b/w Book & Student table)

By: M.Nadeem Akhtar 24

Fig 9.7 (Partial report from book & Student table.)