0% found this document useful (0 votes)
6 views10 pages

Chap No 4

The document discusses the logical view of data, emphasizing its representation over storage, and introduces key concepts such as entities, attributes, and relational databases. It outlines data integrity types, including entity, referential, domain, and user-defined integrity, while contrasting data integrity with data security. Additionally, it addresses data redundancy, its causes, advantages, and methods to reduce it, along with the benefits of relational databases, such as data accuracy, easy access, and flexibility.

Uploaded by

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

Chap No 4

The document discusses the logical view of data, emphasizing its representation over storage, and introduces key concepts such as entities, attributes, and relational databases. It outlines data integrity types, including entity, referential, domain, and user-defined integrity, while contrasting data integrity with data security. Additionally, it addresses data redundancy, its causes, advantages, and methods to reduce it, along with the benefits of relational databases, such as data accuracy, easy access, and flexibility.

Uploaded by

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

A Logical View of Data

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.

 Example: Imagine an online store. The logical view would show:


o Products (name, price, category)
o Customers (name, email, address)
o Orders (order number, date, total amount)

You see the information in tables or forms, but you don’t need to know how it’s stored in
databases.

Entities and Attributes

 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.

Relational Database Management System (RDBMS)

 Definition: An RDBMS is the software or system used to manage and interact with an RDB.

Key Features:

1. Tables store data in rows and columns.


2. Relationships are established through keys (Primary Key and Foreign Key).
3. Uses SQL (Structured Query Language) to interact with data.
 Advantages:
o Ensures data integrity.
o Reduces data redundancy.
o Allows complex queries.
 Examples of RDBMS Software: MySQL, PostgreSQL, Oracle, Microsoft SQL Server.

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

 Definition: Ensures that each row in a table is uniquely identifiable.


 Rules:
o Every table must have a primary key.
o Primary key values must be unique and not null.
 Example:
o An Employee Table with primary key attributes such as:
 EmployeeID: Unique number for each employee.
 Name: Employee names.
o Ensures no two rows have the same EmployeeID, and every employee must have an ID.

Referential Integrity

 Definition: Ensures relationships between tables remain consistent.


 Rules:
o A foreign key in one table must reference a valid primary key in another table.
 Example:
o CustomerInfo Table:
 Primary Key: CustomerID.
o CustomerOrders Table:
 Foreign Key: CustomerID in a CustomerOrders table is a foreign key.
o It ensures that each order in the CustomerOrders Table is associated with a valid
customer in the CustomerInfo Table.

Domain Integrity

 Definition: Ensures data values fall within defined ranges or categories.


 Rules:
o Attributes must follow specified constraints like:
 Data type (e.g., numeric, text).
 Format (e.g., dates as MM/DD/YYYY).
 Range (e.g., salaries must be positive).
 Example:
o A Salary column only accepts:
 Numeric values with two decimal places.
 No negative values.
o Invalid entries (e.g., 100.123 or -50) would be rejected.
User-Defined 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.

Data Integrity vs Data Security

What is Data 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.

2. What is Data Security?

 Definition: Protects data from unauthorized access, theft, or corruption.


 Focus: Safeguarding data from internal or external threats.
 Methods:
o Encryption: Making data unreadable without a key.
o Passwords: Restricting access to authorized users.
o Backups: Keeping a copy of data to restore if it’s lost or corrupted.

Relationship Between Data Integrity and Data Security

 Data Security Protects Data Integrity:


o Security measures (like access controls) prevent unauthorized changes to the data.
o Example: If hackers can’t access a database, they can’t corrupt the data inside.
 Data Integrity Is a Goal of Data Security:
o The ultimate goal of protecting data (security) is to maintain its accuracy and reliability
(integrity).
What is Data Redundancy?

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.

Examples of Data Redundancy:

 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 vs. File-Based Redundancy:

 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.

Advantages of Data Redundancy

  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.

 Advantages of Data Redundancy


  Data Inconsistency: Redundant data can lead to conflicting or incorrect information.
  Increased Data Corruption: More copies increase the risk of data damage.
  Larger Database Size: Redundancy increases database size and complexity.
  Higher Costs: More data storage and management increase operational costs.

. How to Reduce Data Redundancy


 Reduce Redundancy with Master Data: Use Master Data: Master data acts as a central
source of shared information across systems.
Advantages of Relational Databases

 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.

 Easy Access to Data


Users can access data from one or more related tables through JOIN operations, making it simple
to retrieve comprehensive information. SQL queries allow filtering, sorting, and aggregating data
efficiently. This flexibility makes it easier to extract and manipulate the data as needed.

 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.

 Feasible for Future Modifications


Relational databases are designed with scalability in mind, allowing new tables or data fields to
be added as business needs evolve. Changes can be made with minimal impact on the overall
database structure, making it easy to adapt to new requirements or growth in data.

You might also like