
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































BIT 213: Introduction to Database System Notes
1.0 OVERVIEW OF DATABASE SYSTEMS
Data management, which focuses on data collection, storage and retrieval, constitutes a core activity for any organisation. To generate relevant information efficiently you need quick access to data (raw facts) from which the required information is produced. Efficient data management requires the use of a computer database. A database is a shared, integrated computer structure that houses a collection of: -
i. End -user data i.e. raw facts of interest to the user. ii. Meta -data i.e. raw facts of interest to the user iii. Meta data i.e. data about data through which the data is integrated. The Meta data provides a description of the data characteristics and the set of relationships that link the data found within the database. The database resembles a very well organized electronic filing cabinet in which powerful software referred to as DBMS helps manage the cabinet’s contents.
Consider a saving bank enterprise that keeps information about all customers and savings accounts in permanent system files at the bank. The bank will need a number of applications e.g.
i. Program to debit or credit an account ii. A program to add a new account iii. A program to find the balance of an account iv. A program to generate monthly statements v. Any new program would be added as per the banks requirements
Such a typical filing /processing system has the limitation of more and more files and application programs being added to the system at any time. Such a scheme has a number of major disadvantages:
i. Data redundancy and inconsistency - Since the files and application programs are created by different programmers over a long period of type, the files are likely to have different formats and the programs may be written in several programming languages. Moreover, the same piece of information may be duplicated in several files. This redundancy leads to higher storage and access costs. It may also lead to inconsistency i.e. the various copies of the same data may no longer agree.
ii. Difficulty in accessing - Suppose that one of the bank officers needs to find out the names of all customers who live within the city's 78-phone code. The officer would ask the data processing department to generate such a list. Such a request may not have been anticipated while designing the system originally and the only options available are:-
Extract the data manually Write the necessary application, therefore do not allow the data to be accessed conveniently and efficiently
iii. Data isolation - Since data is scattered in various files and files may be in different formats, it may be difficult to write new applications programs to retrieve the appropriate data. iv. Concurrent access anomalies - Interaction of concurrent updates may result in inconsistent data e.g. if 2 customers withdraw funds say 50/= and 100/= from an account at about the same time the result of the concurrent execution may leave the account in an incorrect state. v. Security problems - Not every user of the database system should be able to access all the data. Since application programs are added to the system in an ad-hoc manner, it is difficult to enforce security constraints. vi. Integrity - The data value stored in the database must satisfy certain types of consistency constraints e.g. a balance of a bank account may never fall below a prescribed value e.g. 5,000/=. These constraints are enforced in a system by adding appropriate code in the various application programs. However, when new constraints are added there is need to change the other programs to enforce.
Conclusion. These difficulties among others have prompted the development of DBMS.
Unlike the file system with may separate and unrelated files, the Database consists of logically related data store in a single data repository. The problems inherent in file systems make using the database system very desirable and therefore, the database represents a change in the way the end user data are stored accessed and arranged.
i. Single User database systems
This is a database system that supports one user at a time such that if user A is using the database, users B & C must wait until user A complete his or her database work. If a single user database runs on a personal computer it’s called a desktop database.
process that the DBMS and additional checks before permitting access to sensitive data. Different levels of security can be implemented for various types of data or operations.
The DBMS - software Purchasing or developing S/W H/W Workspace (disks for storage) Migration (movement from tradition separate systems to an integrated one)
You would require adequate backup incase of failure You would require increased severity of security breeches and disruption of operation of the organisation because of downtimes and failures.
Integrated
System
The database eliminates most of the file systems' data inconsistencies, anomalies and structural dependency problems.
The current generation of DBMS software stores not only the data structures in a central location but also stores the relationships between the database components The DBMS also takes care of defining all the required access paths of the required component.
The term database system refers to an organisation of components that define and regulate the collection storage, management and use of data within a database environment. The database system is composed of 5 major parts i.e.
Personnel Department
Accounts Department
Sales Department
employees customer sales inventory accountsaccounts
Personnel Department
Sales Department
Accounting Department
Employees Customers Sales Inventory Accounts
Hardware This identifies all the systems physical devices e.g. the composition peripherals, storage devices etc.
Software These are a collection of programs used by the computers within the database system. i. O.S - manages all hardware components and makes it possible for all other and software to run on the composition. ii. The DBMS - manages the database within the database system e.g. Oracle, DB2, Ms Access etc. iii. Applications programs and utilities to access and manipulate data in the DBMS.
People These are all database systems users:-
i. Scheme definition - The original database scheme is created by writing a set of definitions, which are translated by DDL compiler to a set of tables that are permanently stored in the data dictionary. ii. Storage structure and Access Methods Definitions - By writing a set of definitions for appropriate storage structures and access methods, which are translated by the data storage and definition language compiler. iii. Scheme and physical organisation modifications - Modification to either the database schema or description of the physical storage organisation are accompanied by writing a set of definitions which are used by either the DDL compiler or the data storage and definition language compiler to generate modification to appropriate internal systems tables e.g. data dictionary. iv. Granting authorization to data access - This is so as to regulate which parts of the database users can access. v. The database manager keeps integrity Constrains in a special system structure whenever an update takes place in the system.
Abstraction is the simplification mechanism to hide superfluous details of a set of objects. It allows one to concentrate on the properties that are of interest to the application e.g. a car is an abstraction of personal transportation vehicle but does not reveal details about model, year, colour etc. Vehicle itself is an abstraction that includes the types; car, truck, bus and lorry.
Consider a non- database environment of a number of application programs as shown below:
Application 1 will contain values for the attributes employee Name and Employee. Address and this record can be described in pseudo-code as
Type Employee = record Employee.name:string Employee.address:string End
Application 2 will have:
Type Employee = record Employee.name: String Employee.soc_sec_No: Integer Employee.Adress: String Employee. Annual_salary:integer End
In a non-database environment each application is responsible for maintaining the currency of data and a change in data item.
In a database environment, data can be stored in this application and their requirement be integrated by whoever is responsible for centralized control (DBA). The integrated version would appear as recorded containing attributes required by both applications.
The record will appear as: Type Employee = record Employee.Name:string Employee.soc-sec.no: Integer Employee.Address:string Employee.Annual_Salary: double End
The views supported are derived from the conceptual record by using appropriate mapping.
The application programs no longer require information about the storage structure; storage device types or access methods. These are absorbed by the DBMS.
There are 3 level abstractions corresponding to 3 views: i. The highest level which is seen by the application programs or user called “external or user view" ii. A sum total of users view called global view a conceptual view. iii. Lower level which is the description of the actual method of storing the data. It is also referred to as the internal view.
Local View Employee.Name Employee.Name Employee.Address Employee.Soc_Sec_No Employee.Address Employee.Annual_Sal
Conceptual View Employee.Name:String Employee.Soc_Sec_No:Integer DBA Employee.Address:String Employee.Annual_Sal:Double
Connection to the DBA
Internal View Name:String Length 25 Offset 0 Soc_Sec_No:Integer 9 Offset 25 Address: String Length 5 Offset 34 Salary: 9,2 dec Offset 39
The 3 level scheme architecture is called the ANSI/SPARC model (American National Standard Institute/Standards Planning and Requirements Committee.) It is divided into 3 levels: External Conceptual Internal
The view of each level is described as a scheme, which is an outline or a plan that describes the records and relations existing in the view. It also describes the way in which entities at one level of abstraction can be mapped onto the next level. External Level (External or User view)
User 1 User 2
Mapping between views Two mappings are required, one between external and conceptual views and another between the conceptual records to internal ones.
This is the immunity of users/application programs from changes in storage structure and access mechanism. The 3 levels of abstractions along with the mappings from internal to conceptual and from conceptual to external provide 2 distinct levels of data independence i.e.: Logical Data Independence Physical Data Independence
(i) Logical Data Independence
This indicates that the conceptual schema can be changed without affecting the existing external schema. The mapping between the external and conceptual levels would absorb the change.
It also insulates application programs from operations such as combining two records into one or splitting an existing record into 2 or more records. The LDI is achieved by providing the external level or user view database.
The application programs or users see the database as described by the respective external view. DBMS provided a mapping from this view to the conceptual view. NB: The view at conceptual level of the database is the sum total of the current and anticipated views of the database.
(ii) Physical Data Independence
This indicates that the physical storage structures or devices used for storing the data can be changed without necessitating a change in the conceptual view or any of the external view. Any change is absorbed by the mapping between the conceptual and internal views.
A DBMS is software used to build, maintain and control database systems. It allows a systematic approach to the storage and retrieval of data in a computer. Most DBMS(s) have several major components, which include the following:
the DBMS transform the physically retrieved data to conform to the users logical expectations. This is by providing application programs with software independence and data abstraction.
iv. Security Management - The DBMS creates the systems security that enforces users security and data privacy within the database. Security rules determine which users can access database which data item each user can access and which data operations (read, add, delete, modify) the user may perform. This is important in multi user database system where many users can access the database simultaneously.
v. Multi User Access Control - The database creates complex structures that allow multi- user access to the structure. In order to provide data integrity and consistency the DBMS users sophisticated algorithms to ensure that multiple users can access the database con-currently and still guarantee integrity of the database.
vi. Back-up and recovery management - To ensure data safety and integrity current DBMS systems provide special utilities that allow the DBA to perform routing and special backup and restore procedures. Recovery management deals with recovery of the database after a failure such as a bad sector in the disk, a power failure etc. Such capability is critical to the preservation of the database integrity.
vii. Data integrity Management - The DBMS promotes and enforces integrity rules to eliminate data integrity problems thus minimizing data redundancy and maximizing data consistency. The relationships stored in the Data Dictionary are used to enforce data integrity. Data integrity is especially important in transaction oriented database systems.
viii. Data base Access Language and Application Programming Interfaces - The DBMS provides data access via a query language. It contains 2 components, DDL and DML. The DDL defines the structures in which the data are housed and the DML allows end users to extract the data from the database. It also allows data access to programmers via procedural languages such as Cobol, C, Pascal, and Visual Basic etc. It also provides utilities used by the DBA and the Database Designer to create, implement, monitor and maintain the database.
ix. Database Communication interfaces - Current generation of DBMS's provide special communication routines designed to allow the database to accept end-use r requests within a computer network environment. The DBMS may provide communication functions to access the database through the internet using internet browsers e.g. Netscape or Explorer as the front-ends
A database system is partitioned into modules that deal with each of the responsibilities of the overall systems. The design of the database system must include consideration of the interface between the database system and the O.S. The functional components of a database system include: File Manager Data base manager Query processor DML pre-compiler DDL compiler
File Manager This manages the allocation of space in the disk storage and the data structures used to represent information stored on the disk. It deals more on the physical aspects.
Database Manager Provides the interface between the low level data stored in the database and the application and programs the queries submitted to the system.
Query Processor This translates statements in a query language into low-level instruction that the DB manager understands. In addition the query processor attempts to transform a user request into more efficient statement, thus finding a good strategy for executing the query.
DML Pre-compiler This converts the DML statements embedded in an application program to normal procedure calls in the language. The pre-compiler must interact with the query processor order generate the appropriate code.
DDL Compiler - This converts DDL statements to a set of table containing metadata.
This involves the conceptual design, selection of database, management system software. Creation of the logical design Creation of the physical design
This involves installation of the DBMS Creation of the database Loading or conversion of data
Testing the database Tune the database Evaluate the database application programs Provide the required information flow
Once the database has passed the evaluation stage it is considered to be operational, the database, its management, its users and its application programs constitute a complete I.S. The beginning of the operational phase starts the process of system evaluation.
It involves the following: Preventive Maintenance Corrective maintenance Adaptive maintenance Assignment and maintenance of access permission to new and old user Generation of database access statistics to improve the efficiency and usefulness of audits and to monitor system persons. Periodic security based on the system generated statistics Periodic (monthly, quarterly or yearly) system using summaries for internal billing or budgeting purposes.
A database model is a collection of logical constructs used to represent the data structure and relationships found within the database.
These are models used in describing data at the conceptual and view levels. They are used to specify the overall logical structure of the database and to provide a higher-level description implementation. It is hard to understand.
These are models that are used to describe data at the lowest level. They are very few in number and the two widely known ones are: i. Unifying model ii. Frame memory model
NB: Like the E-R model, the object-oriented model is based on a collection of object where an object contains values stored in instance variables with the object.
It is based on a perception over a real world, which consists of a collection of basic objects called entities and relationships among this objects. An entity is an object that is distinguished from other objects via a specific set of attributes.
The model employs the following components: Entity sets Relationship sets Attributes