Chap No 4
Chap No 4
A logical view of data focuses on what the data represents rather than how it's stored. It
presents data in a structured way that’s meaningful for users, hiding the technical complexities.
You see the information in tables or forms, but you don’t need to know how it’s stored in
databases.
Entity: An object or thing in the real world about which data is stored in a database.
Attribute: The specific details or properties of an entity.
Example:
o Entity: Student
o Attributes: Name, Roll Number, Age, Course, Email
Think of an entity as a "noun" (Student) and attributes as its "details" (Name, Age).
Database Table
Definition: A table is a collection of related data organized into rows and columns.
Columns: Represent attributes of the entity.
Rows: Represent individual entries or records in the table.
Definition: An RDBMS is the software or system used to manage and interact with an RDB.
Key Features:
7. Relational Database
An RDB is the actual data storage system that adheres to the principles of the relational model
proposed by E.F. Codd.
Key Concepts:
1. Tables have Primary Keys: Unique identifiers for each row.
2. Tables link through Foreign Keys: Attributes in one table referencing a Primary Key in
another table.
Data integrity
refers to ensuring the accuracy, consistency, and reliability of data throughout its lifecycle. In the
context of databases, there are four types of data integrity:
Entity Integrity
Referential Integrity
Domain Integrity
Definition: Integrity rules defined by the user to meet specific business requirements outside of
standard rules.
Example:
o An Employee Table includes a custom column for recording Corrective Actions.
o This data is specific to the employer’s needs and doesn’t fall under entity, referential, or
domain integrity.
Definition: Ensures that data is accurate, valid, and consistent over time.
Focus: The quality and reliability of data.
Example:
o Ensuring a customer’s phone number is correctly entered in the database (e.g., no
missing digits or invalid formats).
o Ensuring employee IDs are unique and not duplicated.
Definition:
Data redundancy happens when the same piece of data is stored in multiple places. This is
common in businesses, especially when data is not well-organized. It can lead to inconsistencies
and inefficiencies but is sometimes used intentionally for specific purposes.
A customer’s information (e.g., name and address) is stored in both the Sales table and the
Customer Support table.
In a retailer’s database, a product is accidentally entered twice with slightly different details
(e.g., spelling mistakes or incomplete data).
Why Does Data Redundancy Occur?
1. Accidental Redundancy:
o Happens due to mistakes in data entry or inefficient database design.
o Example: Two employees entering the same customer information in separate systems.
2. Intentional Redundancy:
o Used for data protection or backup purposes.
o Example: Storing the same data in multiple locations to ensure it can be recovered in
case of a system failure.
Database Redundancy:
o Happens in a centralized system.
o Example: A product entered twice in a retail database.
File-Based Redundancy:
o Occurs in individual files or systems that aren’t interconnected.
o Example: A customer’s information stored in separate spreadsheets by different
departments.
Alternative Data Backup: Redundancy provides extra data protection and disaster
recovery.
Better Data Security: Multiple copies help protect against cyber-attacks and breaches.
Faster Data Access and Updates: Quick access and updates across systems.
Improved Data Reliability: Redundancy helps verify data accuracy and
completeness.
Simple Model
Relational databases have a tabular structure consisting of rows and columns, making them
intuitive and user-friendly. Users can interact with the database using basic SQL commands
without needing complex operations. This simplicity helps in faster development and
management.
Data Accuracy
The use of primary keys (unique identifiers) and foreign keys (links between tables) ensures that
data remains consistent and non-redundant. This relationship between tables prevents errors and
ensures that each record is unique. This leads to better data quality and minimizes the chances of
data duplication.
Data Integrity
Relational databases enforce integrity constraints, ensuring data accuracy and consistency. These
constraints maintain valid relationships between tables, like preventing null values in required
fields or ensuring that foreign key values match the primary key in another table. This helps to
avoid inconsistent data.
Flexibility
Relational databases are designed to easily accommodate changes in data and business needs.
New tables, columns, or rows can be added without major disruptions. This adaptability ensures
that the database can grow as the business expands without breaking its structure.
Normalization
Normalization is a process where data is organized to minimize redundancy and avoid
inconsistency. It splits large tables into smaller ones, ensuring that data is stored in the most
efficient way. This process improves query performance and ensures that the database remains
clean and scalable.
High Security
Relational databases allow fine-grained access control to protect sensitive information. With user
roles and permissions, access to specific tables or even individual records can be restricted. This
ensures that only authorized users can view or modify certain data, enhancing security.