DMS UNIT 1
DMS UNIT 1
Introduction To
Database System
Data
Data can be defined as facts or information that can be recorded and have an implicit
meaning.
Database
A database is an organized collection of data so that it can be easily accessed, managed and
updated.
Database:-
Purpose of Database:-
• Data redundancy: Data redundancy refers to the duplication of data, lets say we are
managing the data of a college where a student is enrolled for two courses, the same student
details in such case will be stored twice, which will take more storage than needed. Data
redundancy often leads to higher storage costs and poor access time.
• Data inconsistency: Data redundancy leads to data inconsistency, lets take the same
example that we have taken above, a student is enrolled for two courses and we have student
address stored twice, now lets say student requests to change his address, if the address is
changed at one place and not on all the records then this can lead to data inconsistency.
• Data Isolation: Because data are scattered in various files, and files may be in different
formats, writing new application programs to retrieve the appropriate data is difficult.
• Dependency on application programs: Changing files would lead to change in application
programs.
• Atomicity issues: Atomicity of a transaction refers to “All or nothing”, which means either
all the operations in a transaction executes or none.For example: Lets say Steve transfers 100
Rs to Negan’s account. This transaction consists multiple operations such as debit 100 Rs
from Steve’s account, credit 100 Rs to Negan’s account. Like any other device, a computer
system can fail lets say it fails after first operation then in that case Steve’s account would
have been debited by 100 Rs but the amount was not credited to Negan’s account, in such
case the rollback of operation should occur to maintain the atomicity of transaction. It
is difficult to achieve atomicity in file processing systems.
• Data Security: Data should be secured from unauthorised access, for example a student in a
college should not be able to see the payroll details of the teachers, such kind of security
constraints are difficult to apply in file processing systems.
• Difficulty in accessing data
• Integrity Problem
• Concurrent access anomalies
Data Abstraction
Data abstraction is defined as Suppression of details of data organization and storage
Highlighting of the essential features for an improved understanding of data The characteristic
that allow program data independence and program operation independence is called data
abstraction.
Internal level or Physical level: This is the lowest level of data abstraction. It describes how
data is actually stored in database. The complex data structure details is described at this level.
It is the physical representation of the database on the computer. This level describes how the
data is stored in the database. The internal level is the one that concerns the way the data are
physically stored on the hardware.
Conceptual Level or Logical level: This is the middle level of 3-level data abstraction
architecture. It describes what data is stored in database and the relationships among the data. It
is the community view of the database. This level describes what data is stored in the database
and the relationships among the data. The middle level in the three level architecture is the
conceptual level. This level contains the logical structure of the entire database as seen by the
DBA. It is a complete view of the data requirements of the organization that is independent of
any storage considerations. The conceptual level represents all entities, their attributes, and their
relationships.
External Level or View level: This is highest level of data abstraction. This level describes the
user interaction with database system. It is the users' view of the database. This level describes
that part of the database that is relevant to each user. External level is the one which is closest to
the end users. This level deals with the way in which individual users view data. Individual users
are given different views according to the user's requirement.
Data independence:
The ability to modify or change schema definition of one level without affecting schema
definition in the next Higher level.
Database schema:-
The overall design of the database is called the database schema. A schema diagram displays
only names of record types (entities) and names of data items (attributes) and does not show the
relationships among the various files.
Codd’s Rule
• Rule 1: Information Rule–
Everything in a database must be stored in a table format.
• Rule 2: Guaranteed Access Rule
Every single data element (value) is guaranteed to be accessible logically with a
combination of table-name, primary-key (row value), and attribute-name (column value
• Rule 3: Systematic Treatment of NULL Values
The NULL values in a database must be given a systematic and uniform treatment.
• Rule 4: Active Online Catalog
The structure description of the entire database must be stored in an online catalog,
known as data dictionary, which can be accessed by authorized users.
• Rule 5: Comprehensive Data Sub-Language Rule
• A database can only be accessed using a language that supports data definition, data
manipulation, and transaction management operations..
• Rule 6: View Updating Rule
• All the views of a database, which can theoretically be updated, must also be updatable
by the system.
• Rule 7: High-Level Insert, Update, and Delete Rule
• A database must support high-level insertion, updation, and deletion.
• Rule 8: Physical Data Independence
• The data stored in a database must be independent of the applications that access the
database..
• Rule 9: Logical Data Independence
• The logical data in a database must be independent of its user’s view (application).
• Rule 10: Integrity Independence
• A database must be independent of the application that uses it. All its integrity constraints
can be independently modified without the need of any change in the application.
• Rule 11: Distribution Independence
• The end-user must not be able to see that the data is distributed over various locations.
Users should always get the impression that the data is located at one site only. This rule
has been regarded as the foundation of distributed database systems.
• Rule 12: Non-Subversion Rule
• If a system has an interface that provides access to low-level records, then the interface
must not be able to subvert the system and bypass security and integrity constraints.
Overall Structure of DBMS
2-Tier Architecture:-
3-Tier Architecture:-
The 3-Tier architecture contains another layer between the client and server.
In this architecture, client can't directly communicate with the server.
The application on the client-end interacts with an application server which further
communicates with the database system.
End user has no idea about the existence of the database beyond the application server. The
database also has no idea about any other user beyond the application.
The 3-Tier architecture is used in case of large web application.
Data Model:-
Underlying structure of the database is called as data model. It is a collection of
conceptual tools for describing data, data relationships, data semantics and
consistency constraints. Data models define how data is connected to each other
and how they are processed and stored inside the system.
Hierarchical model:-
• This database model organizes data into a tree-like-structure, with a single root,
to which all the other data is linked. The hierarchy starts from the Root data,
and expands like a tree, adding child nodes to the parent nodes.
• In this model, a child node will only have a single parent node.
• This model efficiently describes many real-world relationships like index of a
book, recipes etc.
• In hierarchical model, data is organized into tree-like structure with one one-to-
many relationship between two different types of data, for example, one
department can have many courses, many professors and of-course many
students.
Network Model:-
• This is an extension of the Hierarchical model. In this model data is organized
more like a graph, and are allowed to have more than one parent node.
• In this database model data is more related as more relationships are established
in this database model. Also, as the data is more related, hence accessing the
data is also easier and fast. This database model was used to map many-to-
many data relationships.
• This was the most widely used database model, before Relational Model was
introduced
Components of a Database: