I-UNIT
Database Concepts:Database Systems - Data vs Information - Introducing the
database -File system -Problems with file system – Database systems. Data
models - Importance - Basic Building Blocks -Business rules - Evolution of Data
models - Degrees of Data Abstraction.
Introduction
Data:
Data is a collection of raw facts and figures that do not have any meaning on
their own, but can be processed to produce useful information.
The facts that can be recorded and which have implicit meaning known as
'data'.
Example:
Customer
1.cname.
2.cno.
3.ccity.
Database:
It is a collection of interrelated data.
These can be stored in the form of tables.
A database can be of any size and varying complexity.
A database may be generated and manipulated manually or it may be
computerized.
Example:
Customer database consists the fields as cname, cno, and ccity
Database System:
It is computerized system, whose overall purpose is to maintain the
information and to make that the information is available on demand.
Advantages:
Redundancy can be reduced.
Inconsistency can be avoided.
Data can be shared.
Standards can be enforced.
Security restrictions can be applied.
Integrity can be maintained.
Data gathering can be possible.
Requirements can be balanced.
DBMS
A database-management system (DBMS) is a collection of interrelated data
and a set of programs to access those data.
The collection of data, usually referred to as the database, contains
information relevant to an enterprise.
Data vs Information
Definition of Data:
Data is a raw, unorganized fact or value that has no meaning by itself.
Examples:
25, "Alice", "Blue", 98.6
Definition of Information:
Information is processed or organized data that is meaningful and useful for decision-
making.
Examples:
"Alice is 25 years old"
"The temperature is 98.6°F"
Introduction to Database
What is a Database?
A Database is an organized collection of related data that can be easily accessed,
managed, and updated.
Examples of Databases:
o Library Database – Stores book records, members, and issue history
o Bank Database – Stores customer info, account details, transactions
o School Database – Stores student records, marks, attendance
Need for a Database:
o To store large amounts of data systematically
o To avoid data duplication (redundancy)
o To ensure data accuracy (consistency)
o To retrieve data quickly
o To share data among multiple users
Components of a Database System:
o Data – Raw facts stored in the database
o DBMS – Software to manage the database
o Users – People who use the database system
o Hardware – Devices on which the database runs
Database Table Example:
StudentID Name Class Marks
101 Ravi 10 87
102 Meena 10 92
Advantages of Using a Database:
o Better data management
o Data sharing among users
o Security and access control
o Backup and recovery options
o Ensures data integrity
File system
A file system is a traditional method of storing and organizing data in files on a
disk.
Example:
o Student records stored in a .txt file
101, Ravi, 10, 85
102, Meena, 10, 90
Drawbacks in File System
There are so many drawbacks in using the file system. These are mentioned below −
Data redundancy and inconsistency: Different file formats, duplication of
information in different files.
Difficulty in accessing data: To carry out new task we need to write a new
program.
Data Isolation − Different files and formats.
Integrity problems.
Atomicity of updates − Failures leave the database in an inconsistent state.
For example, the fund transfer from one account to another may be
incomplete.
Concurrent access by multiple users.
Security problems.
Database system offers so many solutions to all these problems
What is a Database System?
A Database System is a combination of database and DBMS (Database
Management System) that stores, manages, and processes data efficiently.
Components:
1. Database – Organized data
2. DBMS – Software to manage data
3. Users – Admins, developers, end users
4. Hardware & Software – For storing and accessing data
What is a Data Model?
A Data Model is a way to define, structure, and organize data. It shows how
data is connected and how it can be stored, retrieved, and updated.
Purpose of Data Models:
To represent the logical structure of a database
To define the relationships among data
To help in designing the schema (database structure)
Types of Data Models in DBMS
Data Model Type Description Example
Data organized in a tree-like Employee →
Hierarchical Model
structure (parent-child) Department
Data in a graph structure (many- Student ↔
Network Model
to-many relationships) Course
Data stored in tables (relations) SQL Databases
Relational Model
with rows and columns like MySQL
Entity-Relationship Uses entities, attributes, and
ER diagrams
(ER) Model relationships
Data Model Type Description Example
Object-Oriented Data represented as objects (like Multimedia
Model in OOP) databases
Document/Data For unstructured/semi-
MongoDB
Models (NoSQL) structured data like JSON/XML
Most Popular: Relational Data Model
Proposed by E. F. Codd
Data stored in tables (relations)
Uses primary keys and foreign keys to relate data
Supports SQL (Structured Query Language)
ER Model (Entity-Relationship Model)
o Used in database design
o Key components:
Entity – Real-world object (e.g., Student)
Attribute – Properties (e.g., Name, Age)
Relationship – Association between entities (e.g., Enrolls)
Importance of Data Models in DBMS:
Importance Explanation
Helps in designing the structure (schema) of the
Database Design
database before actual implementation.
Defines Data Clearly represents how different data items relate to
Relationships each other (e.g., Student ↔ Course).
Improves Acts as a blueprint for developers, DBAs, and
Communication stakeholders to understand the system clearly.
Supports Data Helps define rules like primary keys, foreign keys, and
Integrity constraints to ensure data accuracy.
Efficient Data Enables organized data storage which makes retrieval
Access faster and more efficient.
Scalability and Makes it easier to update, expand, or modify the
Maintenance database without affecting existing data.
Importance Explanation
Platform for DBMS Many DBMS features like query optimization, indexing,
Tools and reporting are built based on the data model.
Basic Building Blocks in DBMS
In a Database Management System (DBMS), the entire system is built on some core
components called building blocks. These define how data is stored, related, and
accessed.
1. Data
Raw facts stored in the database (e.g., numbers, names, dates)
Example: 101, Alice, 85, Computer Science
2. Table (Relation)
A table is the main structure used to store data in rows and columns.
Example:
ID Name Marks
101 Alice 85
102 Bob 90
3. Tuple (Row/Record)
A tuple is a single row in a table representing one record.
Example: 101, Alice, 85 is one tuple in the above table.
4. Attribute (Column/Field)
An attribute is a column name in a table, representing a data property.
Example: ID, Name, Marks are attributes.
5. Domain
A domain is the set of valid values an attribute can have.
Example: The domain of Marks may be from 0 to 100.
6. Schema
A schema is the overall structure/design of the database.
Example: Student(ID, Name, Marks) defines the schema for a student table.
7. Instance
An instance is the actual data stored in the database at a given moment.
Example: The contents (records) inside the Student table right now.
8. Keys
Keys are used to uniquely identify rows and maintain relationships between tables.
o Primary Key – Uniquely identifies each record
o Foreign Key – Links one table to another
What are Business Rules?
Business rules are guidelines or constraints that define how data is created,
stored, and processed in a database system according to the needs of an
organization.
They ensure that the database reflects real-world rules of the business.
Purpose of Business Rules:
o To maintain data integrity
o To reflect real-world logic in the database
o To enforce organizational policies in the database system
o To ensure accuracy and consistency of data
Examples of Business Rules:
Business Rule Explanation
A student can register for a Limits the number of entries in the
maximum of 5 courses student-course table
An employee's salary must be greater
Data validation rule
than the minimum wage
A customer cannot place an order
Enforces input constraint
without a valid email
A product code must be unique Ensures no duplicates (Primary Key)
How Business Rules are Enforced in DBMS:
Method Description
Like NOT NULL, UNIQUE, CHECK, PRIMARY KEY, FOREIGN
Constraints
KEY
Automatic actions based on specific conditions (e.g., logging
Triggers
changes)
Stored
Predefined logic to apply rules while inserting/updating data
Procedures
Application Rules enforced in the front-end application before data
Logic reaches the DBMS
Types of Business Rules:
1. Structural Rules – Define valid data structure (e.g., uniqueness of IDs)
2. Behavioral Rules – Define actions or restrictions (e.g., “Cannot delete
customer if orders exist”)
Evolution of Data Models
1. File-Based System (Before DBMS) – 1960s
Data stored in flat files (text files)
No relationships between data
High redundancy, inconsistency, and difficulty in retrieval
2. Hierarchical Data Model – Late 1960s
Data organized in a tree-like structure (parent-child)
One-to-many relationship
Fast access but rigid structure
Example: IBM’s Information Management System (IMS)
3. Network Data Model – 1970s
Data in a graph structure with many-to-many relationships
More flexible than hierarchical
Complex to manage and navigate
Example: CODASYL DBTG model
4. Relational Data Model – 1970s (Most Popular)
Introduced by E. F. Codd (IBM) in 1970
Data stored in tables (relations)
Uses SQL for querying
Supports data independence, integrity, and easy updates
Examples: Oracle, MySQL, PostgreSQL
5. Entity-Relationship (ER) Model – 1976
High-level conceptual model
Uses entities, attributes, and relationships
Useful for designing relational databases
Used in ER Diagrams during design phase
6. Object-Oriented Data Model – 1980s–1990s
Integrates database with object-oriented programming
Stores data as objects
Supports inheritance, encapsulation
Used in multimedia, CAD applications
7. Semi-Structured & XML Data Models – 1990s
For irregular and hierarchical data (e.g., web data)
Supports tags, attributes (like in XML/JSON)
Schema may not be fixed
Example: XML databases, JSON stores
8. NoSQL (Non-Relational) Models – 2000s–Present
Designed for big data, distributed systems
Supports key-value, document, column, graph models
Highly scalable and schema-less
Examples: MongoDB, Cassandra, Neo4j
Degrees of Data Abstraction in DBMS
What is Data Abstraction?
Data Abstraction refers to the hiding of unnecessary details from the user
and showing only the essential information.It helps users interact with the system
without needing to understand complex internal details.
Purpose of Data Abstraction:
Simplifies database usage
Improves data security
Separates user view from physical storage
Makes database design more flexible and manageable
Three Levels (Degrees) of Data Abstraction
Level Description
Physical Describes how data is actually stored in the database (e.g., file
Level structure, indexing)
Logical Describes what data is stored and the relationships among the
Level data (e.g., schema)
View Describes how data is seen by end users; can have multiple
Level views for different users
Example: Student Database
Level Example Description
Physical
Data stored in files with B+ trees and hashing
Level
Logical
Table: Student(RollNo, Name, Marks) with primary key = RollNo
Level
View User sees only Name and Marks, not the internal structure or full
Level schema