Unit - 1
Unit - 1
1. Data:
• Fact that can be recorded or stored.
• E.g. Person Name, Age, Gender and Weight etc.
2. Information:
• When data is processed, organized, structured or presented in a given context so as to make
it useful, it is called information.
3. Database:
• A Database is a collection of inter-related (logically-related) data.
• E.g. Books Database in Library, Student Database in University etc.
5. Metadata:
• Metadata is data about data.
• Data such as table name, column name, data type, authorized user and user access privileges
for any table is called metadata for that table.
6. Data Dictionary:
• Data dictionary is an information repository which contains metadata.
• It is usually a part of the system catalog.
7. 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.
8. Record:
• A record is a collection of logically related fields.
• For examples, collection of fields (id, name, address & city) forms a record for customer.
1. Data Redundancy:
• It is possible that the same information may be duplicated in different files. This leads to data
redundancy. Data redundancy results in memory wastage.
• For example, consider that some customers have both kinds of accounts - saving and current.
In this case, data about customers such as name, address, e-mail and contact number will be
duplicated in both files, saving accounts file and current account file.
• In other words, same information will be stored in two different locations (files). And, it wastes
memory.
2. 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.
5. 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.
6. 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.
• This leaves database in consistent state. But, it is difficult to ensure atomicity in a file
processing system.
8. Security Problems:
• Database should be accessible to users in a limited way.
• Each user should be allowed to access data concerning his application only.
• For example, a customer can check balance only for his/her own account. He/She should not
have access for information about other accounts.
• But, in file processing system, application programs are added in an ad hoc manner by different
programmers. So, it is difficult to enforce such kind of security constraints.
4. Data Access:
• DBMS utilizes a variety of techniques to retrieve data.
• Required data can be retrieved by providing appropriate query to the DBMS.
• Thus, data can be accessed in convenient and efficient manner.
5. 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.
6. 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.
7. 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.
8. 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.
2. Banking:
• Banks use databases for customer inquiry, accounts, loans, and other transactions.
3. Education:
• Schools and colleges use databases for course registration, result, and other information.
4. Telecommunications:
• Telecommunication departments use databases to store information about the communication
network, telephone numbers, record of calls, for generating monthly bills, etc.
6. E-commerce:
• Integration of heterogeneous information sources (for example, catalogs) for business activity
such as online shopping, booking of holiday package, consulting a doctor, etc.
9. Finance:
• Databases are used for storing information such as sales, purchases of stocks and bonds or data
useful for online trading.
10. Sales:
• Databases are used to store product, customer and transaction details.
1. External level
2. Conceptual level
3. Internal level
1. Internal Level:
• This is the lowest level of the data abstraction.
• It describes how the data are actually stored on storage devices.
• It is also known as a physical level.
• The internal view is described by internal schema.
• Internal schema consists of definition of stored record, method of representing the data field
and access method used.
3. External Level
• This is the highest level of data abstraction.
• It is also known as view level.
• It describes only part of the entire database that a particular end user requires.
• External view is describes by external schema.
• External schema consists of definition of logical records, relationship in the external view and
method of deriving the objects from the conceptual view.
• This object includes entities, attributes and relationship.
1. Mapping:
• The process of transforming requests and results between the three levels is called mapping.
2. Types of Mapping:
• Conceptual/Internal Mapping
• External/Conceptual Mapping
1. Data Independence:
• Data independency is the ability to modify a schema definition in one level without affecting a
schema definition in the next higher level.
• A database model is a type of data model that defines the logical structure of a
database.
• A data model is a conceptual representation of the data structures that are required by
a database.
• To use a common analogy, the data model is equivalent to an architect's building plans.
• It determines how data can be stored, accessed and updated in a database management
system.
• The most popular example of a database model is the relational model, which uses a table-
based format.
• Facilitate interaction among the designer, the applications programmer and the end user.
1. Hierarchical Model:
• The hierarchical model organizes data into a tree-like structure, where each record has a
single parent or root.
• The hierarchy starts from the Root data, and expands like a tree, adding child nodes to the
parent nodes.
• In hierarchical model, data is organized into tree-like structure with one-to-many relationship
between two different types of data, for example, one department can have many professors
and many students.
• Oldest data base model. (1950’s)
• Tree structure is most frequently occurring relationship.
• Advantages:
• Simplicity
• Data security
• Data Integrity
• Efficiency : When contains large no of relations
• Disadvantages:
• Implementation complexity
• Database management problem : maintaining difficult
• Lack of structural independence
• Programming complexity
2. Network Model:
• This is an extension of the hierarchical model, allowing ma many-to-many relationships in a
tree-like structure that allows multiple parents.
• Graph structure.
• Allow more connection between nodes.
• Ex: An employee work for two departments is not possible in hierarchical model, but here it
is possible.
• Advantages
• Conceptual simplicity.
• Can handle more relationships.
• Ease of data access.
• Data integrity.
• Data independence.
• Database standards.
• Disadvantages
• System Complexity
• Absence of structural independence
3. Entity-relationship Model:
• In this database model, relationships are created by dividing object of interest into entity
and its characteristics into attributes.
4. Relational Model:
• In this model, data is organized in two-dimensional tables and the relationship is maintained
by storing a common attribute.
• Data in the form of table
• each table = an entity.
• each row = instances of that entity.
• Most popular database model.
• Advantages
• Structural independence
• Conceptual simplicity
• Design , implementation , maintenance and usage ease
• Query capability
• Very powerful
• Flexible
• Disadvantages
• Hardware Overhead
• Can lead to bad database design
• Complex to understand when there is more number of tables.