Database
Database
SYSTEMS
1
Database Systems
A database is an organized collection of related data, designed to meet the information needs of an organization.
Database software enables you to organize and store data so that specific items of information can be retrieved
easily and quickly in a structured fashion.
Most institutions in today’s world make use of database systems for various purposes.
Databases may be used to organize and store information about students in a school, stock in a supermarket,
citizens in a country, employees in a company and in many other areas.
Parts of a database
The main components of a database are tables, queries, forms and reports.
Tables
Databases store information in tables (files).
A table is an organised collection of related records.
A table is divided into rows and columns. Each row holds a record and each column represents a unique field.
For example, in a student table a row would store the information about one particular student. This is called a
record.
Each column would contain details about each student such as first name, surname etc. These are called fields.
Typically a database system will consists of more than one table. For example in a school library system, the
database might be made up of a student table, a book table and a loan table.
Relationships can be defined between tables and used to support the searching and processing of data.
A relational database will have at least two tables that are linked together.
Fields
2
Record
A record is a group of related fields (for example about one student).
A record is a row in a table.
In the table above, all of the information about each student is stored in a row/record.
In the above table, there are 8 student records.
Field
A field is a data item within a record.
A field is a column in a table.
The student table above contains six fields which are student id, first name, surname, sex, class and age.
Query
A query is a method of searching for information in a database.
A query allows you to ask questions about the data in your tables according to a certain criteria.
A user may wish to display a list of students who are 14 years of age. This is known as a select query.
An update query makes specified changes to a group of records, or to all records in one or more tables.
A delete query deletes a group of records from one or more tables. Queries can also be used to take data from
more than one table and perform calculations on data.
In the example shown in the table below, a select query has been produced of students who are 14 years of age.
You will notice that there are 4 records in the output from this query. In the original student table there were 8
records. 4 of the 8 students are 14 years of age.
Report
A report is an attractive display of the information from your database.
Reports provide a professional – looking output from a table or a query.
They are mainly used to display details as well as summary information about the contents of a database.
Reports can be generated that contain column charts and other graphs which summarise the data.
Forms
Forms are used mainly to display the records in a user – friendly way.
Through a form, you can enter and edit records more easily.
A form will also include some command buttons for carrying out operations such as saving, deleting, printing,
searching, sorting records.
3
1. Banking: For customer information, accounts, and loans, and banking transactions.
2. Airlines: For reservations and schedule information. Airlines were among the first to use databases in a
geographically distributed manner—terminals situated around the world accessed the central database system
through phone lines and other data networks.
3. Universities: For student information, course registrations, and grades.
4. Credit card transactions: For purchases on credit cards and generation of monthly statements.
5. Telecommunication: For keeping records of calls made, generating monthly bills, maintaining balances on
prepaid calling cards, and storing information about the communication networks.
6. Finance: For storing information about holdings, sales, and purchases of financial instruments such as stocks
and bonds.
7. Sales: For customer, product, and purchase information.
8. Manufacturing: For management of supply chain and for tracking production of items in factories, inventories
of items in warehouses/stores, and orders for items.
9. Human resources: For information about employees, salaries, payroll taxes and benefits, and for generation of
paychecks.
10. The internet – many of the sites on the internet are driven by databases applications. The database store web
pages, video, audio files etc.
Database Approach
The problems inherent in file systems make using a database system very desirable.
Unlike the file system, with its many separate and unrelated files, the database system consists of logically
related data stored in a single logical data repository
Because the database’s data repository is a single logical unit, the database represents a major change in the
way end-user data are stored, accessed, and managed.
The database’s DBMS, shown in below, provides numerous advantages over file system management, shown
above, by making it possible to eliminate most of the file system’s data inconsistency, data anomaly, data
dependence, and structural dependence problems.
4
Advantages of database approach
b) Data consistency
By eliminating or controlling redundancy, we reduce the risk of inconsistencies occurring.
If a data item is stored only once in the database, any update to its value has to be performed only once and the
new value is available immediately t all users.
d) Data sharing
Typically, files are owned by the people or departments that use them.
On the other hand, the database belongs to the entire organization and can be shared by all authorized users.
In this way, more users share more of the data.
c) Improved security
Database security is the protection of the database from unauthorized users.
A DBMS allows a DBA to define and enforce data security.
This may take the form of user names and password to identify people authorized to use the database.
The access that an authorized user is allowed on the data may be restricted by the operation type e.g. retrieve,
insert, update, delete.
g) Enforcement of standards
5
Use of a database allows the DBA to define and enforce the necessary standards.
These may include departmental, organizational, national, or international standards.
These standards may concern such things as data formats to facilitate exchange of data between systems,
naming conventions, document standards etc.
h) Economies of scale
Combining all the organizations operational data into one database can result in cost savings.
In this case, the budget that would normally be allocated to each department for the development and
maintenance of its file based system can be combined, possibly resulting in a lower total cost, leading to an
economy of scale.
c) Hardware costs
The disk storage requirements for the DBMS and the database may necessitate the purchase of additional
storage space.
In order to achieve the required performance, it may be necessary a larger dedicated machine to run the DBMS.
d) Performance
A file based system is written for a specific application, such as invoicing. As a result, performance is generally
very good.
However, a DBMS is written to be more general, to cater for many applications rather than just one.
The effect is that some applications may not run as fast as they do.
e) Training
Staff needs to be trained to use these new systems. There is also need to employ specialist staff to help with the
running and conversion of the system.
This can even result to extra costs.
6
A software system that enables users to define, creates, maintain and control access to the database.
The DBMS is hence a general-purpose software system that facilitates the processes of defining, constructing,
and manipulating databases for various applications.
Defining a database involves specifying the data types, structures, and constraints for the data to be stored in
the database.
Constructing the database is the process of storing the data itself on some storage medium that is controlled by
the DBMS.
Manipulating a database includes such functions as querying the database to retrieve specific data, updating the
database to reflect changes in the miniworld, and generating reports from the data.
The DBMS is the software that interacts with the user’s application programs and the database. Typically a
DBMS provides the following facilities:
1. It allows users to define the database, usually through a Data Definition Language (DDL). The DDL allows
users to specify the data types and structures and the constraints on the data to be stored in the database.
2. It allows users to insert, update, delete, and retrieve data from the database, usually though a Data Manipulation
Language (DML).
3. It also provides controlled access to the database so as to prevent unauthorized users from accessing the
database.
A computer program that interacts with the database by issuing an appropriate request (typically an SQL
statement) to the DBMS.
Users interact with the database through a number of application programs that are used to create and maintain
the database and to generate information.
These programs can be conventional batch applications, or more typically nowadays, they will be online
applications.
The application programs may be written in some programming language or in some higher level fourth
generation programming language.
Components of a DBMS
We can identify five major components in the DBMS environment: hardware, software, data, procedures and
people.
1. Hardware
The DBMS and the application programs require hardware to run on.
The hardware can range from a single personal computer, to a single mainframe or even to a network of
computers.
The particular hardware depends on the organization’s requirements and the DBMS used.
The DBMS requires a minimum amount of main memory and disk space to run, but this minimum
configuration may not necessarily give acceptable performance.
2. Software
Although the most readily identified software is the DBMS itself, to make the database system function fully,
three types of software are needed: operating system software, DBMS software, and application programs and
utilities.
Operating system software manages all hardware components and makes it possible for all other software to run
on the computers. Examples of operating system software include Microsoft Windows, Linux, Mac OS, UNIX,
and MVS.
DBMS software manages the database within the database system. Some examples of DBMS software include
Microsoft’s SQL Server, Oracle Corporation’s Oracle, Sun’s MySQL, and IBM’s DB2.
Application programs and utility software are used to access and manipulate data in the DBMS and to manage
the computer environment in which data access and manipulation take place.
7
Application programs are most commonly used to access data found within the database to generate reports,
tabulations, and other information to facilitate decision making.
Utilities are the software tools used to help manage the database system’s computer components.
Typically application programs are written in a Third Generation Programming Language (3GL), such as C,
C++, JAVA, VISUAL BASIC, COBOL or Pascal, or using a fourth Generation Language (4GL) such as SQL
embedded in a 3GL.
3. Data
The word data covers the collection of facts stored in the database.
The data is the most important component of the DBMS environment, especially from the end-users point of
view.
Because data are the raw material from which information is generated, the determination of what data are to be
entered into the database and how those data are to be organized is a vital part of the database designer’s job.
The data acts as a bridge between the machine components (i.e. hardware and software) and the human
components (users).
A database contains both the operational data and the Meta data (i.e. data about the data).
4. Procedures
Procedures refer to the instructions and rules that govern the design and use of the database.
Procedures play an important role in a company because they enforce the standards by which business is
conducted within the organization and with customers.
Procedures are also used to ensure that there is an organized way to monitor and audit both the data that enter
the database and the information that is generated through the use of those data.
The users of the system and the staff that manage the database require documented procedures on how to use or
run the system.
These may consist of instructions on how to:
a) Logging in or out of the DBMS.
b) Use a particular DBMS facility or application program.
c) Make backup copies of the database
d) Handle hardware and software failures.
5. People
The major goal of a database system is to retrieve information from and store new information in the database.
People who work with a database can be subdivided into three main categories namely: end users, database
application programmers and database administrators.
These users are differentiated by the way they expect to interact with the database system. Different types of
user interfaces have been designed for the different types of users.
a) End Users
These are unsophisticated users whose jobs require access to the database for querying, updating and generating
reports so as to run the organization’s daily operations.
For example, salesclerks, supervisors, managers, and directors are all classified as end users. High-level end
users employ the information obtained from the database to make tactical and strategic business decisions.
Many end users simply use applications written by the database application programmers, and so require little
technical knowledge about DBMS software.
They simply invoke database operations by entering simple commands or choosing options from a menu. The
tasks that such users perform are varied:
Bank tellers check account balances and post withdrawals and deposits.
Till operators at supermarkets uses a barcode reader to find out the price of the item from the database.
Reservation agents for airlines and hotels check availability for a given request and make reservations.