Академический Документы
Профессиональный Документы
Культура Документы
Database
Database:-
Database is an organized collection of related data that is stored in an efficient
and compact manner.
The word organized means that data is stored in such a way that the user can use
this data easily. The word related means that a database is normally created to
store the data about a particular topic.
For example if a database is created for students, it will contain data about the
students such as roll no, name, address etc. Similarly, if the database is about the
employees of an organization, it will contain the data of employees such as
employees ID, grade and salary etc. All data in database is arranges in tables.
The word efficient means that the user can search the required data quickly. The
word compact means that the stored data occupies as little space as possible in
computer.
Tables:-
Table is the fundamental object of the database structure. The basic purpose
of a table is to store data. A table consists of rows and columns. A table is a very
convenient way to store data. The data in tables can be manipulated easily.
Rows/Record:-
Rows are the horizontal part of the table. It is a collection of related fields.
For example, the above table has three rows. Each row contains a record of
different person.
Columns/ Field:-
Columns are the vertical part of the table, For example, all values in the
above table under “Name” field make a column.
2
Name
Usman
Abdullah
Ejaz
A single column
Examples of Databases:-
Following are some important examples of databases:
1. Phone Directory:-
Phone directory is a simple example of a database. A phone
directory stores the phone numbers of different persons. Searching a
phone number from phone directory is very easy as all phone
numbers are stored in an organized way.
2. Library:-
A library contains thousands of books. It is very difficult to handle
the records of all these books without database. A database system
can be used to store the records of books, search the required books
easily. This database can help for doing research work.
3. College:-
A college has many students in different classes. A database may be
used to keep the records of the students, fee transactions,
examination information and other data of the college. It can also
store the attendance of the students.
1. It provides the facility to define the structure of database. The user can
specify data types, format and constraints for the data to be stored in
database.
2. It provides the facility to store data on some storage medium controlled by
DBMS.
3. It provides the facilities to insert, delete, update and retrieve specific data to
generate reports etc.
1. Repository:-
A repository is a collection of all data definitions, data relationships, output
styles and report formats etc. All this information is the metadata that is
important to manage database.
2. Database Management System:-
A database management system (DBMS) is a collection of programs that
are used to create and maintain a database.
3. Database:-
Database can be defined as an organized collection of related data. The
word “organized” means that data is stored in such a way that user can
store, manipulate and retrieve data easily.
4. Application Program:-
An application program is program that is used to send commands to the
database management system to manipulate database. These commands are
sent to the DBMS through graphical user interface. The user interface with
the application program and the application program further interacts with
the database management system. Two important application programs are
developer 2000 and power Builder.
5. User Interface:-
The user interface is a visual environment that is used to communicate with
the computer. It consists of menus, buttons and other components. All
windows based software use graphical user interface. The user interface
consists of following components. It will contain forms, menus and reports.
6. Data Administrators:-
Data administrators are the persons who are responsible of whole
information system. They authorize access to the database as well as
coordinate and monitor the use of database.
7. System Analysts and Application Programmers:-
System analysts determine the requirements of end users and develop
specifications for transactions. Application programmers implement these
specifications and programs.
8. End User:-
End users are those persons who interact with the application directly. They
are responsible to insert, delete and update data in the database. They get
information from the system as and when required.
Database Approach:-
Database approach has many advantages over file processing system.
1. Redundancy Control:-
The data in a database appears only once and is not duplicated. For
example the data of a student in college database is stored in one table.
The table can be accessed for different purposes. For examples, if we
4
want to store the marks of student in a table, only roll No of the student
will be used in second table. The second table will be connected to the
student table for accessing the information about the student as follows:
Student Table
Roll No Name Address Email Phone
1 Usman Faisalabad usman@yahoo.com 727253
2 Abdullah Faisalabad Abdullah@yahoo.com 784692
Marks Table
Roll No Subjects Marks
1 Math 98
1 English 87
2 Math 81
2 English 92
In the above figure, the details of the students are stored in student table. The
marks table stores only the Roll No of students. The remaining data is not
duplicated. Roll No in the Marks table is duplicated for joining two tables.
2. Data Consistency:-
An important benefit of controlling redundancy is that the data is
consistent. If a data item appears only at one place, It is easy to maintain. If it is
required to update data the updating is performed at only one place. The change
will automatically take effect at all places where ever this data is used.
3. Consistency Constraints:-
Consistency constraints are the rules that must be followed to enter data in
database. If the constraints are not fulfilled, data cannot be entered in database.
Database Management systems provide an easy way to apply different consistency
to ensure data consistency. For example, a constraint can be applied to ensure that
the data is always entered in a specific range etc.
4. Data Atomicity:-
A collection of all steps to complete a process is known as transaction. Data
atomicity means that either a transaction should take place as a whole or it should
not take place at all. It ensures that the database will always have correct and
consistent data. Suppose a user wants to transfer money from account A to account
B. This process consists of two steps:
1. Deduct the money from account A.
2. Add the money to account B.
Suppose that the system fails when the computer has performed the first step. It
means that the amount has been deducted from account A but has not been added
to account B. This situation can make data inconsistent. The database management
5
system does not allow such a situation to happen. Database management system
either executes both steps or does not execute any step.
5. Data Security:-
Data security is the protection of the database from unauthorized access.
The database management system provides several procedures to maintain data
security. The security is maintained by allowing access to the database through the
use of passwords. Not every use of database system should be able to access all
the data.
In some situations, it is required to provide different types of access
permission to data for different users. For example, a data entry operator should
only be allowed to enter data. The chairman of the organization should be able to
access or delete the data completely. Database management system provides
different levels of security options for different users.