Dbms ch1
Dbms ch1
Record: Collection of related data items, e.g. in the above example the
three data items had no
meaning. But if we organize them in the following way, then they collectively
represent meaningful
information.
Roll Name Age
1 ABC 19
The columns of this relation are called Fields, Attributes or Domains. The rows are
called Tuples
or Records.
Database: Collection of related relations. Consider the following collection of
tables:
T1 T2
Roll Name Age Roll Address
ABC 19 KOL
DEF 22 DEL
XYZ 28 MUM
T3 T4
5
We now have a collection of 4 tables. They can be called a “related collection” because
we can clearly find out that there are some common attributes existing in a
selected pair of tables. Because of these common attributes we may combine
the data of two or more tables together to find out the complete details of a
student. Questions like “Which hostel does the youngest student live in?” can be
answered now, although
1 – Introductory Concepts of DBMS
Age and Hostel attributes are in different tables.
In a database, data is organized strictly in row and column format. The rows are called
Tuple or Record. The data items within one row may belong to different data types.
On the other hand, the columns are often called Domain or Attribute or Fields. All
the data items within a single attribute are of the same data type.
Information:-
When data is processed, organized, structured or presented
in a given context so as to make it useful, it is called
information.
Example:-A student secures 450 marks. Here 450 is data,
| – Database Management System (DBMS) 1
1 – Introductory Concepts of DBMS
marks of the student is the information.
DATA DATA DATA
Processing
Information
Database
A Database is a collection of inter-related data.
DBMS (Database Management System)
A database management system is a collection of inter-
related data and set of programs to manipulate those data.
DBMS = Database + Set of programs
A simple example of a university database.
Metadata
Metadata is data about data.
Data such as table name, column name, data type,
| – Database Management System (DBMS) 2
1 – Introductory Concepts of DBMS
authorized user and user access for any table is called
metadata for that table.
Example :-Table metadata(The names, data types,
constraints for columns for a table)
Table named “customers” might have columns for
“customer ID”(integer,primary key)”First name”(varchar) and
“last name”(varchar).
Data dictionary
Data dictionary is information which contains metadata.
It is usually a part of the system catalog.
Data warehouse
Data warehouse is information which stored data.
It is design to facilitate reporting and analysis.
Field
A field is a character or group of characters that have a specific
meaning.
It is also called a data item. It is represented in the database by a
value.
For Example customer id, name, society and city are all fields for
customer Data.
Record
A record is a collection of logically related fields.
For examples, collection of fields (id, name, society & city) forms
a record for customer.
Will be duplicated in both files, file for saving accounts and file
for current accounts. This leads to requirement of higher
storage space. In other words, same information will be
stored in two different locations (files). And, it wastes
memory.
Data Inconsistency
Due to data redundancy, it is possible that data may not be in
consistent state.
For example, consider that an address of some customer
changes. And, that customer has both kinds of accounts.
Now, it is possible that this changed address is updated in
only one file, leaving address in other file as it is. As a result
of this, same customer will have two different addresses in
two different files, making data inconsistent.
Difficulty in Accessing Data
Accessing data is not convenient and efficient in file processing
system.
For example, suppose, there is a program to find information
about all customers. But, what if there is a need to find out
all customers from some particular city. In this case, there
are two choices here: One, find out all customers using
available program, and then extract the needed customers
manually. Second, develop new program to get required
information. Both options are not satisfactory.
For each and every different kind of data access, separate
programs are required. This is neither convenient nor
efficient.
Limited Data Sharing
Data are scattered (distrubted) in various files.
Different files may have different formats. And these files
may be stored in different folders (directories) may be of
different computers of different departments.
So, due to this data isolation, it is difficult to share data among
different applications.
| – Database Management System (DBMS) 5
1 – Introductory Concepts of DBMS
Integrity Problems
Data integrity means that the data contained in the database
is both correct and consistent. For this purpose, the data
stored in database must satisfy certain types of constraints
(rules).
For example, a balance for any account must not be less
than zero. Such constraints are enforced in the system by
adding appropriate code in application programs. But, when
new constraints are added, such as balance should not be
less than Rs. 5000, application programs need to be
changed. But, it is not an easy task to change programs
whenever required.
Atomicity Problems
Any operation on database must be atomic. This means,
operation completes either 100% or 0%.
For example, a fund transfer from one account to another
must happen in its entirely. But, computer systems are
vulnerable to failure, such as system crash, virus attack. If a
system failure occurs during the execution of fund transfer
operation, it may possible that amount to be transferred, say,
Rs. 500, is debited from one account, but is not credited to
another account.
Data Integrity
Data in database must be correct and consistent.
So, data stored in database must satisfy certain types of
constraints (rules).
DBMS provides different ways to implement such type of
constraints (rules).
This improves data integrity in a database.
Data Security
Database should be accessible to user in a limited way.
DBMS provides way to control the access to data
for different user according to their requirement.
It prevents unauthorized access to data.
Thus, security can be improved.
Concurrent Access
Multiple users are allowed to access data
simultaneously.
Concurrent access to centralized data can be allowed
under some supervision.
This results in better performance of system and faster
response.
Guaranteed Atomicity
Any operation on database must be atomic. This
means, operation must be executed either 100% or
0%.
This type of atomicity is guaranteed in DBMS.