0% found this document useful (0 votes)
7 views

Database

A database is an organized collection of related data stored and accessed electronically. It consists of tables, queries, forms and reports. Tables store data in rows and columns. Queries search and retrieve data. Forms and reports present data to users. Databases are widely used in applications like banking, education, retail and more. They provide advantages over manual paper systems by reducing redundancy, ensuring data consistency, and enabling more analysis of integrated data.

Uploaded by

Tadiwa Mangudhla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Database

A database is an organized collection of related data stored and accessed electronically. It consists of tables, queries, forms and reports. Tables store data in rows and columns. Queries search and retrieve data. Forms and reports present data to users. Databases are widely used in applications like banking, education, retail and more. They provide advantages over manual paper systems by reducing redundancy, ensuring data consistency, and enabling more analysis of integrated data.

Uploaded by

Tadiwa Mangudhla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

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

Student ID First Name Surname Sex Class Age

ST0001 Arethra Chawawa Female 2A 14

ST0002 Tafadzwa Marere Female 2B 14

ST0003 Kelvin Kodzwa Male 2A 15


Records
ST0004 Mary Jane Female 2C 14

ST0005 James Mavhunga Male 2D 14

ST0006 Anna Karuru Female 2B 15

ST0007 Audrey Mazhambe Female 2B 15

ST0008 Tedious Matete Male 2C 13

A table in a Student database

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.

Student ID First Name Surname Sex Class Age

ST0001 Arethra Chawawa Female 2A 14

ST0002 Tafadzwa Marere Female 2B 14

ST0004 Mary Jane Female 2C 14

ST0005 James Mavhunga Male 2D 14

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

Database System Applications

Databases are widely used. Here are some representative applications:

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.

Manual paper based systems


 In order to be successful, an organization must come up with systems for handling core business tasks.
Historically, such systems were often manual, paper-and-pencil systems.
 The papers within these systems were organized in order to facilitate the expected use of the data. Typically,
this was accomplished through a system of file folders and filing cabinets.
 As long as a data collection was relatively small and an organization’s business users had few reporting
requirements, the manual system served its role well as a data repository.
 However, as organizations grew and as reporting requirements became more complex, keeping track of data in a
manual file system became more difficult.
 Therefore, companies looked to computer technology for help.

Disadvantages of manual based systems


1. Can take a while to manually search through all of the records.
2. Very difficult to analyze or sort data.
3. Changes have to be done manually; thus records can look messy if scribbled out.
4. Records can be lost or misfiled making it hard to find them.
5. No data security, only security being to lock up the room that contains the records.
6. Difficult to make back up, because every page/card would have to be re-written or photocopied.
7. Paper based files are vulnerable to natural disasters such as fire, water, termites, rodents etc.
8. One incurs the cost of filing cabinets plus the cost for the space that is required to store the paper files.
9. Stationary costs incurred to buy more books, pens etc.
10. Calculations are done manually, thus prone to human error.
11. System cannot produce ad-hoc reports and this delays decision making.
12. There is a lot of data duplication in files, this result in wastage of storage space and stationary.
13. A lot of transcription errors are encountered during data entry, this can lead to data inconsistency.

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

a) Redundancy can be reduced


 Data redundancy refers to unnecessary duplication of data.
 The database approach attempts to eliminate the redundancy by integrating the files so that multiple copies of
the same data are not stored.

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.

c) More information from the same amount of data


 With the integration of the operational data, it may be possible for the organization to derive additional
information from the same data.

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.

b) Improved data integrity


 Data integrity refers to the correctness and consistency of stored data.
 Integrity is usually expressed in terms of constraints, which are consistency rules that the database is not
permitted to violate.
 For example, an integrity constraint could state that a high school student’s age cannot be greater than 20 years.

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.

i) Improved backup and recovery


 Many file-based systems place the responsibility on the user to provide measure to protect the data from failures
to the computer system.
 This may involve taking a mighty backup of the data.
 In the event of a failure during the next day, the backup is restored and the work that has taken place since this
backup is lost and has to be re-entered.
 DBMS provide facilities to minimize the amount of information that is lost following a failure.

j) Increased concurrency control


 In some file-based systems, if two or more users are allowed to access the same file, simultaneously, it is
possible that the accesses will interfere with each other.
 This can result in loss of information or even loss integrity.
 DBMS manage concurrent database access and ensure such problems cannot occur.

Disadvantages of database systems

a) Higher impact of failure


 The centralization of resources the vulnerability of the system.
 Since all users and applications rely on the availability of the DBMS, the failure of certain components can
bring operations to a halt.

b) DBMS are expensive


 DBMS are relatively expensive, ranging even to millions. There are also maintenance costs and costs of hiring
DBAs.

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.

Database Management System

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.

Database Application Programs

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

b) Database Application Programmers


 Application programmers are responsible for writing the application programs used by end users to
communicate with the database.

You might also like