II PUC CHAPTER 8: DATABASE
CHAPTER - 8
DATA BASE CONCEPTS
Data :
In simple terms, "data" refers to a collection of facts, figures, or information, often used to analyze
something or make decisions.
Database :
A database is an organized collection of structured information, or data, typically stored electronically in a
computer system.
Database concepts:
Database concepts encompass the principles and techniques used to organize, store, and manage data
efficiently, including data modeling, schema design, data types, relationships, and querying
File:
A computer file is defined as a medium used for saving and managing data in the computer system.
Contents of a file can be texts, computer program code, comma separated values (CSV), etc. Likewise,
pictures, audios/videos, web pages are also files.
Files stored on a computer can be accessed directly and searched for desired data. But to access data of a
file through software.
Limitations of a File System:
✓ Difficulty in Access ✓ Data Isolation
✓ Data Redundancy ✓ Data Dependence
✓ Data Inconsistency ✓ Controlled Data Sharing
Difficulty in Access:
File systems do not typically have sophisticated querying capabilities, making it difficult to access data.
Data Redundancy:
Redundancy means same data are duplicated in different places (files). Redundancy leads to. Excess
storage use and may cause data inconsistency also.
Data Inconsistency :
Data inconsistency occurs when same data maintained in different places do not match. Data
inconsistency is the lack of standardization and uniformity in data across different sources, systems, or
formats.
Data Isolation :
The ability to segregate and protect data by preventing unauthorized access or leakage, ensuring that
sensitive information remains secure and accessible only to authorized users or processes. This is because
data mapping is not supported in file system.
Data Dependence:
Data are stored in a specific format or structure in a file. If the structure or format itself is changed, all the
existing application programs accessing that file also need to be changed. Otherwise, the programs may
not work correctly.
IDEAL JAYANAGAR 1
II PUC CHAPTER 8: DATABASE
Controlled Data Sharing : Controlled data sharing in a file system involves restricting access to files and
directories based on user permissions, often using techniques like access control lists (ACLs) or encryption,
ensuring only authorized users can access specific data.
Database management system :
A database is an organized collection of data, often managed by a software called a Database
Management System (DBMS), that allows users to store, retrieve, and manage information efficiently.
Some examples of open source and commercial DBMS include MySQL, Oracle, PostgreSQL, SQL Server,
Microsoft Access, MongoDB.
The DBMS serves as an interface between the database and end users or application programs.
Use of Database in Real-life Applications :
Application Database to maintain data about
File System to DBMS:
A File System is a method of storing and organizing files on a computer, while a DBMS (Database
Management System) is a software application designed to manage and manipulate data in a database
DBMS offers significant advantages over file systems, particularly for managing large, complex datasets
with features like data integrity, security, and concurrent access
Example:Imagine you're managing a library.
• File system:
You might have separate text files (one for each book) stored in folders representing different genres
(fiction, biography, etc.). Finding a specific book would involve navigating the folders and files.
• Database system:
You'd create a database with tables like "Books" (with columns for title, author, ISBN, genre) and
potentially "Authors" and "Genres" for relationships. Using SQL queries, you could easily search for books
by author, genre, or any other criteria.
Key Concepts in DBMS
➢ Database Schema ➢ Meta-data or Data Dictionary
➢ Data Constraint ➢ Database Instance
IDEAL JAYANAGAR 2
II PUC CHAPTER 8: DATABASE
➢ Query ➢ Database Engine
➢ Data Manipulation
Database Schema
Database Schema is the design(structure table names and their fields/columns) of a database.
Database schema is also called the visual or logical architecture as it tells us how the data are organized in
a database.
Data Constraint
Database constraints are rules that enforce data accuracy and integrity by restricting the types of data that
can be stored in a table. Common types include primary key, foreign key, unique, not null, check, and
default constraints.
Meta-data or Data Dictionary
The database schema along with various constraints on the data is stored by DBMS in a database catalog
or dictionary, called meta-data. A meta-data is data about the data
Database Instance
A database instance is a specific instantiation of a database system, containing the operational database
and associated resources, including memory structures and processes, that manage database files and
serve users.
Query
Queries act as the bridge between users and databases, enabling them to communicate with the system
to extract specific information or perform various operations on the data.
Data Manipulation
Modification of database consists of three operations viz. Insertion, Deletion or Update.
The process of transforming, cleaning, and organizing data to make it more usable and meaningful for
analysis and insights
Database Engine
Database engine is the underlying component or set of programs used by a DBMS to create database and
handle various queries for data retrieval and manipulation.
A database engine is the core software component that manages and processes data within a database
system, handling tasks like storing, retrieving, updating, and deleting data, ensuring data integrity and
security.
Data model
A data model describes the structure of the database, including how data are defined and represented,
relationships among data, and the constraints.
DBMS are available and their classification is done based on the underlying data model
Types of data models
1. Relational data model 2. Object-oriented data model 3. Entity-relationship data model
4. Document model 5. Hierarchical data model.
Relational data model:
In relational model, tables are called relations that store data for different columns. / A database that is
modeled on relational data model concept is called Relational Database
IDEAL JAYANAGAR 3
II PUC CHAPTER 8: DATABASE
Each table can have Multiple columns where each column name should be unique.
It is important to note here that relations in a database are not independent tables, but are associated
with each other.
ATTRIBUTE/FILED : Characteristic or parameters for which data are to be stored in a relation.
TUPLE: Each row of data in a relation (table) is called a tuple.
DOMAIN: It is a set of values from which an attribute can take a value in each row.
DEGREE: The number of attributes in a relation is called the Degree of the relation
CARDINALITY: The number of tuples in a relation is called the Cardinality of the relation.
Three Important Properties of a Relation
Property 1: Rules on an attribute of the relation :
• Each attribute in a relation has a unique name.
• Sequence of attributes in a relation is immaterial.
Property 2: Governs following rules on a tuple of a relation.
• Each tuple in a relation is distinct.
• Sequence of tuples in a relation is immaterial are not considered to be ordered.
Property 3: imposes following rules on the state of a relation.
• All data values in an attribute must be from the same domain (same data type).
Each data value associated with an attribute must be atomic (cannot be further divisible into meaningful
subparts)
• No attribute can have many data values in one tuple.
• A special value “NULL” is used to represent values that are unknown or non-applicable to certain
attributes.
Keys In a relational database :
The tuples within a relation must be distinct. It means no two tuples in a table should have same value for
all attributes.
IDEAL JAYANAGAR 4
II PUC CHAPTER 8: DATABASE
That is, there should be at least one attribute in which data are distinct (unique) and not NULL.
Different types of keys are :
1. Candidate Key 2. Primary Key 3. Composite Primary Key 4. Foreign Key
Candidate Key:
In relational database design, a candidate key is a minimal set of attributes (columns) that can uniquely
identify each row (tuple) in a table, meaning no subset of those attributes can also uniquely identify each
row.
Primary Key:
A primary key is a column or set of columns in a table that uniquely identifies each row. It's used to
enforce data integrity and ensure that each row in a table has a unique identifier.
Composite Primary Key:
A composite primary key in database design is a primary key that consists of two or more columns that
together uniquely identify each row in a table.
Foreign Key:
In database management, a foreign key is a column (or a set of columns) in one table that references the
primary key of another table, establishing a link between the two tables and enforcing referential
integrity.
IDEAL JAYANAGAR 5