0% found this document useful (0 votes)
7 views22 pages

Unit 1

The document provides an overview of database concepts, including definitions of databases and database management systems (DBMS), types of DBMS, and the distinctions between data and information. It discusses the limitations of traditional file systems compared to DBMS, key features of DBMS, and various data models used in the industry. Additionally, it highlights the advantages of using data models in ensuring accurate representation and minimizing data redundancy.

Uploaded by

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

Unit 1

The document provides an overview of database concepts, including definitions of databases and database management systems (DBMS), types of DBMS, and the distinctions between data and information. It discusses the limitations of traditional file systems compared to DBMS, key features of DBMS, and various data models used in the industry. Additionally, it highlights the advantages of using data models in ensuring accurate representation and minimizing data redundancy.

Uploaded by

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

SSDM COLLEGE,KOVILPATTI

DATABASE MANAGEMENT SYSTEM


III BSC (CS & IT)
UNIT-1
DATABASE CONCEPTS
DATABASE
 Database is a collection of related data
 Data is a collection of facts and figures that can be processed to produce
information.
 Mostly data represents recordable facts.
 Data aids in producing information, which is based on facts.
 For example, if we have data about marks obtained by all students, we can then
conclude about toppers and average marks.
DATABASE SYSTEM (or) DBMS
 Database system or Database management system(DBMS) is a software that
allows to create, update and retrieval of data in an organized way.
 It also provides security to the database.
 From small applications to enterprise systems, DBMS plays a vital role in
supporting data-driven decision-making and operational efficiency.
Example:
A university database can store and manage student information, faculty
records, and administrative data, allowing seamless retrieval, insertion, and
deletion of information as required.
Types of DBMS
There are several types of Database Management Systems (DBMS), each adapted
to different data structures, scalability requirements, and application needs. The most
common types are as follows:
1. Relational Database Management System (RDBMS)
 Examples: MySQL, Oracle, Microsoft SQL Server, Postgre SQL and
Snowflake.
2. NoSQL DBMS
 Examples: MongoDB, Cassandra, DynamoDB and Redis.
3. Object-Oriented DBMS (OODBMS)
Examples: ObjectDB, db4o

Data vs. Information


 Data and information are closely related concepts, but they have distinct
differences.
 Data refers to raw facts, figures, or symbols that have not been organized or
processed in any meaningful way.
 It is often unstructured and lacks context or relevance.
 On the other hand, information is the result of processing and organizing data to
make it meaningful and useful.
 It provides context, meaning, and insights that can be used for decision-making or
understanding a particular subject.
 In essence, data is the building block, while information is the end product that
adds value and meaning to the data.

Attribute Data Information


Processed, organized, and meaningful
Definition Raw facts, figures, or symbols
data
Representation Numbers, text, images, etc. Reports, charts, graphs, etc.

Context Can be context-independent Depends on context for meaning

Structure Unorganized and unstructured Organized and structured


Requires interpretation to derive
Interpretation Already interpreted and meaningful
meaning
Used as input for generating Used for decision-making and
Usage
information understanding
Can be processed to become
Processing Processed data
information
Has added value through
Value Has intrinsic value
interpretation
Storage Stored in databases, files, etc. Stored in knowledge repositories
Data
 Temperature Readings: Numbers representing temperature throughout the
day, such as "72°F", "68°F", "75°F".
 Student Grades: A list of numerical scores obtained by students on a test, like
"85", "92", "78".
Information
 Weather Report: Based on the temperature reading a weather report can be
generated.
 Grade Average: Based on the student grades, the average grade of class can be
derived.
Introducing to database
Key Features of DBMS
1. Data Modeling: Tools to create and modify data models, defining the structure and
relationships within the database.
2. Data Storage and Retrieval: Efficient mechanisms for storing data and executing
queries to retrieve it quickly.
3. Concurrency Control: Ensures multiple users can access the database
simultaneously without conflicts.
4. Data Integrity and Security: Enforces rules to maintain accurate and secure data,
including access controls and encryption.
5. Backup and Recovery: Protects data with regular backups and enables recovery in
case of system failures.
Need for DBMS
 Simplicity: It was easy to create and manage files without requiring specialized software.
 Low Cost: There was no need to invest in additional tools or training to use file systems.
 Direct Access: Users could access files directly from storage devices.
File System
 The file system is basically a way of arranging the files in a storage medium like a
hard disk.
 The file system organizes the files and helps in the retrieval of files when they are
required.
 File systems consist of different files which are grouped into directories.
 The directories further contain other folders and files.
 The file system performs basic operations like management, file naming, giving
access rules, etc.
PROBLEMS WITH FILE SYSTEM
File system in DBMS is the traditional approach of managing databases
and there are many limitations of this approach. Following are the major
limitations of a file based system:
Separated and Isolated Data:
 To take decisions, the user might need to access data from two separate
files.
 For example, if a user wants academic information and the fee of a
student, then he needs two different files, i.e. general office and account
office.
 We cannot access all the data from a single file, as it separately stores
data for each file.
Duplication of Data:
 Often, the same information is stored in multiple files and it costs more
time and money.
 As in the university database, name, class, roll no is the same
information of a student that is stored in different files. So, in a file-
based system, data duplication is there.
Data Dependence:
 If the format of a certain record was changed, then we must update the
record in each file containing that format to avoid confusion.
 Hence, it is difficult to determine relationships between isolated data to
meet user requirements.
Data Inflexibility:
Data in-dependency and data isolation limited the flexibility of the file
processing system.
Data Security:
 In the file-based system the security of data is low because data is
maintained in files and is easily accessible.
 And there are no security mechanisms to protect the files.
Transaction Problem:
The file-based system does not satisfy transaction properties.
Concurrency Problem:
 When multiple users access the same piece of data at the same interval
of time, then it is called the concurrency of the system.
 And if they want to update a file simultaneously, then a concurrency
problem occurs in a file-based system.
FILE SYSTEM Vs DBMS

Basics File System DBMS


Structure The file system is a way of arranging the DBMS is software for managing the
files in a storage medium within a database.
computer.
Data Redundant data can be present in a file In DBMS there is no redundant data.
Redundancy system.
Backup and It doesn't provide Inbuilt mechanism for It provides in house tools for backup
Recovery backup and recovery of data if it is lost. and recovery of data even if it is lost.
Query There is no efficient query processing in Efficient query processing is there in
processing the file system. DBMS.
Consistency There is less data consistency in the file There is more data consistency
system. because of the process
of normalization .
Complexity It is less complex as compared to DBMS. It has more complexity in handling
as compared to the file system.
Security File systems provide less security in DBMS has more security
Constraints comparison to DBMS. mechanisms as compared to file
systems.
Cost It is less expensive than DBMS. It has a comparatively higher cost
than a file system.
Data There is no data independence. In DBMS data independence exists,
Independence mainly of two types:
1) Logical Data Independence .
2)Physical Data Independence.
User Access Only one user can access data at a time. Multiple users can access data at a
time.
Meaning The users are not required to write The user has to write procedures for
procedures. managing databases
Sharing Data is distributed in many files. So, it is Due to centralized nature data
not easy to share data. sharing is easy
Data It give details of storage and It hides the internal details
Abstraction representation of data of Database
Integrity Integrity Constraints are difficult to Integrity constraints are easy to
Constraints implement implement
Attributes To access data in a file , user requires No such attributes are required.
attributes such as file name, file location.

Data models
 Data models in DBMS help to understand the design at the conceptual, physical,
and logical levels
 As it provides a clear picture of the data making it easier for developers to create a
physical database.
 Data models are used to describe how the data is stored, accessed, and updated in a
DBMS.
 A set of symbols and text is used to represent them so that all the members of an
organization can understand how the data is organized.
 It provides a set of conceptual tools that are vastly used to represent the description
of data.
There are many types of data models that are used in the industry.
Types of Data Models in DBMS
 Hierarchical Model
 Network Model
 Entity-Relationship Model
 Relational Model
 Object-Oriented Data model
 Object Relational Data Model
 Semi-Structured Data Model
 Associative Data Model
 Context Data Model
Hierarchical Model
 The hierarchical data model is one of the oldest data models, developed in
the 1950s by IBM.
 In this data model, the data is organized in a hierarchical tree-like structure.
 This data model can be easily visualized because each record in DBMS has one parent and
many children (possibly 0) as shown in the image given below.

KIA SCODA

 The above-given image represents the data model of the Vehicle database, vehicle
are classified into two types like two-wheelers and four-wheelers and then they are
further classified.
 The main drawback we can see here is we can only have one too many
relationships under this model, hence the hierarchical data model is very rarely
used nowadays.
Network Model
 A network model is nothing but a generalization of the hierarchical data
model as this data model allows many to many relationships therefore in this
model a record can also have more than one parent.
 The network model in DBMS can be represented as a graph and hence it replaces
the hierarchical tree with a graph in which object types are the nodes and
relationships are the edges.
For example

 Here you can see all three departments are linked with the director which was not
possible in the hierarchical data model.
 In the network model, there can be many possible paths to reach a node from the
root node (College is the root node in the above case), therefore the data can be
accessed efficiently when compared to the hierarchical data model.
 But, on the other hand, the process of insertion and deletion of data is quite
complex.
Entity-Relationship Model (ER Model)
 An Entity-Relationship model is a high-level data model that describes the structure
of the database in a pictorial form which is known as ER-diagram.
 In simple words, an ER diagram is used to represent logical structure of the
database easily.
 ER model develops a conceptual view of the data hence it can be used as a blueprint to
implement the database in the future.
Developers can easily understand the system just by looking at ER diagram.
Components of an ER diagram.
Entity
 Anything that has an independent existence about which we collect the data.
 They are represented as rectangles in the ER diagram.
 For example - Car, house, employee.
Entity Set
 A set of the same type of entities is known as an entity set.
 For example - Set of students studying in a college.
Attributes
 Properties that define entities are called attributes.
 They are represented by an ellipse shape.
Relationships
 A relationship in DBMS is used to describe the association between entities.
 They are represented as diamond or rhombus shapes in the ER diagram.

 In the above-represented ER diagram, we have two entities that are Employee and
Company, and the relationship among them.
 Also, in the above-represented ER diagram, we can see that both the employee and
company have some attributes and the relationship is of "works in" type, which
means the employee works in a company.
Relational Model
 This is the most widely accepted data model.
 In this model, the database is represented as a collection of relations in the form of
rows and columns of a two-dimensional table.
 Each row is known as a tuple (a tuple contains all the data for an individual record)
while each column represents an attribute.
For example
Stu. Id Name Branch
101 AKIL CS
102 AMAR CA
103 SIRI IT
104 NIVI IT
 The above table shows a relation "STUDENT" with attributes such as Stu. Id,
Name, and Branch which consists of 4 records or tuples.
Object-Oriented Data model
 As suggested by its name, the object-oriented data model is a combination of
object-oriented programming and relational data model.
 In this data model, the data and their relationship are represented in a single
structure which is known as an object.
 Since data is stored as objects we can easily store audio, video, images, etc in the
database which was very difficult and inconvenient to do in the relational model.
As shown in the image below two objects are connected with each other through links.

 In the above image, we have two objects that are Employee and Department in
which all the data is contained in a single unit (object).
 They are linked with each other as they share a common
attribute i.e Department_Id.
Object Relational Data Model
 Again as suggested by its name, the object-relational data model is an integration
of the object-oriented model and the relational model.
 Since it inherits properties from both of the models it supports objects, classes, etc
like object-oriented models, and tabular structures like the relational model.
For example

 It provides data structures and operations used in the relational model and also
provides features of object-oriented models like classes, inheritance, etc.
 The only drawback of this data model is that it is complex and quite difficult to handle.
Semi-Structured Data Model
 A semi-structured data model is a generalized form of the relational model, which
allows representing data in a flexible way.
 Hence we cannot differentiate between data and schema in this model because, in
this model, some entities have a missing attribute(s) and on the other hand, some
entities might have some extra attribute(s) which in turn makes it easy to update
the schema of the database.
For example We can say a data model is semi-structured if in some attributes we
are storing both atomic values (values that can't be divided further, for example,
Roll_No) as well as a collection of values.
Associative Data Model
The associative data model sees the data in the same way as the brain does. The
relationship is expressed as a simple English sentence of the form "subject-verb-object".
For example :
From the sentences
 Siva is a customer
 Siva’s customer id is 645.
 Neeraj is a customer
 Neeraj's customer id is 784.
We can make the following table -
Cust_ID Name
645 Siva
784 Neeraj
Context Data Model
 The context model is nothing but a combination of several data models that have been
discussed above.
 For example, a context model can be a combination of a network model, ER model, etc.
 This data model allows one to do many things which were not possible if he/she use a
single data model.
Advantages of Data Models in DBMS
 Data models ensure that the data is represented accurately.
 The relationship between the data is well-defined.
 Data Redundancy in DBMS can be minimized and missing data can be identified
easily.
 Last but not least, the security of the data is not compromised.
Disadvantages of Data Models in DBMS
 The biggest disadvantage of the data model is, one must know the characteristics of
physical data to build a data model.
 Sometimes in big databases, it is quite difficult to understand the data model also the
cost incurred is very high.
Importance of Data Models in DBMS:
1. Organizing Data:
Data models help in organizing and structuring data in a logical manner,
making it easier to manage and access.
2. Data Integrity:
By defining constraints and rules, data models ensure the integrity of the
stored data, preventing inconsistencies and errors.
3. Efficient Querying:
A well-designed data model optimizes query performance, enabling faster
retrieval of information.
4. Scalability and Flexibility:
Data models provide scalability by accommodating changes in data
requirements without disrupting the entire system.
5. Standardization:
They provide a standardized way of representing data, facilitating
communication and collaboration among stakeholders.
Building blocks of a Data Model
 A data model is a structure of the data that contains all the required details of the data
like the name of the data, size of the data, relationship with other data and constraints
that are applied on the data.
 It is a communication tool. A data model is essential in order to store the database in a
sorted manner.
 It will provide the interaction between the system analyst, designer and application
programmer.
 It improves the understanding of designing of the database in which the organization
is interested.
A data model constitutes of building blocks. They are:
1. Entities
2. Attributes
3. Relationships
4. Constraints
These are explained as following below in brief.
1. Entities:
 Entities are real time objects that exist.
 It can be a person, place, object, event, concept.
 Entities are represented by a rectangle box containing the entity name in it.
Example: Student, employee.
2. Attributes:
 It is the set of characteristics representing an entity.
 It is represented by a ellipse symbol with attribute name on it.
Example: A student has attributes like name, roll number, age and much more.
3. Relationship:
 It describes the association between two entities.
 It is represented using diamond symbol containing relationship name with it.
 The data model generally uses three kinds of relationships:
one to many, many to many, one to one.
Example: The relationship between two entities Student and Class has many to
many relationship.
4. Constraints:
 Constraints are conditions applied on the data.
 It provides the data integrity.
Example: A student can take a maximum of 2 books from the library is applied as
a constraint on the student database.
Business Rules
 Business rules in data models define the conditions, constraints, and relationships that
guide how data is structured and used within an organization.
 Business rules are crucial because they ensure that data models accurately reflect
real-world operations.
 They capture the policies, procedures, and standards that must be followed when
storing and processing data.
 Without clear business rules, models can become disorganized and fail to support
effective decision-making.
Benefits of Implementing Business Rules in Data Modeling
Business rules play a crucial role in shaping how data is stored, related, and protected
within a database. Here are five key benefits:
 Clear Data Definition:
Business rules define what data is collected, ensuring that only relevant and
necessary information is stored in the database.
 Structured Hierarchical Relationships:
They help establish how entries relate to one another, building clear, consistent
hierarchies and relationships between data points.
 Enhanced Data Security:
Business rules enforce access controls and validation measures, safeguarding
sensitive information and ensuring compliance with security standards.
 Higher Data Quality:
By setting rules for allowed values, mandatory fields, and referential integrity,
business rules prevent errors, duplicates, and inconsistencies in the database.
 Customized Operational Alignment:
Business rules tailor the data model to match the unique processes and priorities
of an organization, ensuring the database accurately reflects business needs.
Types of Business Rules in Data Models
Business rules can be categorized based on how they define, structure, and control
information within a data model. Understanding these types helps in translating business
requirements into effective database structures. Here are the four main types:
1. Definitions of Business Terms:
 These guidelines define the meanings of terms used throughout the
organization.
 Defining business language ensures that everyone shares a common
understanding of the terminology.

2. Facts Relating Terms to Each Other:


 Facts describe how different terms or entities are related.
 They capture the structure of the organization by mapping relationships, such as
a customer placing an order.
3. Constraints (Action Assertions):
 Constraints restrict how data can be entered or modified.
 They enforce business policies by preventing actions that violate organizational
rules, ensuring data integrity, and operational control.
4. Derivations:
 Derivations explain how new information is created from existing data.
 These rules show how certain values or knowledge can be calculated or inferred
from other information.
Data Abstraction
 In DBMS (Database Management System), data abstraction refers to the process of
hiding the complexities of the database system from the user and providing a simplified
interface to interact with the data.
 It ensures that users can access data without needing to understand the elaborated details
of how the data is stored or managed internally.
 This is achieved through three levels/degrees of data abstraction in the data model:
1. Physical Level (Internal Level)
 This is the lowest level of abstraction that describes how the data is physically stored in the
database.
 It includes information about file structures, indexing, storage blocks, and access methods.
 It focuses on optimizing storage and retrieval mechanisms.
 Example: Knowing that a table is stored as a B-tree index or a heap file.
2. Logical Level (Conceptual Level)
 This level describes what data is stored in the database and the relationships among the
data.
 It defines the schema, constraints, and structure of the database without worrying about
how the data is stored physically.
 It provides a unified view of the entire database for database administrators and
developers.
 Example: A table named Students with attributes like StudentID, Name, and Age.
3. View Level (External Level)
 This is the highest level of abstraction that defines how the data is presented to end-
users.
 It provides customized views of the database tailored to specific user needs, hiding
irrelevant details.
 It ensures security and simplicity by restricting access to sensitive data and showing only
relevant information.
 Example: A user sees only the Name and Age columns of the Students table, while
the StudentID is hidden.
Key Benefits of Data Abstraction
 Simplifies Interaction: Users can work with data without needing to understand its
storage or retrieval mechanisms.
 Enhances Security: Sensitive data can be hidden at the view level.
 Improves Flexibility: Changes at one level (e.g., physical) do not affect other levels
(e.g., logical or view).
 Supports Scalability: Makes it easier to adapt the database to new requirements.
 This layered abstraction ensures that the database system is both user-friendly and
efficient while maintaining data integrity and security.

You might also like