0% found this document useful (0 votes)
26 views12 pages

Data Abstraction

Uploaded by

Tejinder Singh
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)
26 views12 pages

Data Abstraction

Uploaded by

Tejinder Singh
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/ 12

Data Abs traction

Data abstraction is the procedure of concealing irrelevant or unwanted data from the end user.

The main purpose of data abstraction is to hide irrelevant data and provide an abstract view of the data. With the help of data
abstraction, developers hide irrelevant data from the user and provide them the relevant data. By doing this, users can access the data
without any hassle, and the system will also work efficiently.

example, if you go to a shop to buy a pair of shoes, you ask the shopkeeper to show you the shoes of a certain company, and you also
tell the shopkeeper about the size, color, and material you want.

will you be asking the shopkeeper questions such as, where are these shoes made? From where does the material come? What is t he
cost of the material?

The answer to these questions is NO.

You will not ask these questions because these questions are of no use. You do not care about these questions. You are only concerned
about a few things, such as the company, size, color, material, and how the shoes look. That is why these unimportant details are kept
hidden from the end user. This is the process we call data abstraction.
Logical Level: View Level :
Physical The logical level provides a
conceptual view of the database
The view level provides a
customized or tailored view of

Level: that hides the details of how data


is physically stored. It defines the
the database for specific users or
applications. It allows users to
database schema, including the define virtual tables or views that
This is the lowest level of
abstraction and deals with how structure of tables, relationships present a subset of the data or

data is stored on the physical between tables, integrity hide sensitive information. Views
constraints, and security can also combine data from
storage devices such as disks. It
includes details such as data constraints. Users interact with multiple tables or perform

storage format, file organization, the database at this level by calculations to provide a more
writing queries and commands in convenient representation of the
indexing methods, and access
paths. Users and applications a high-level data definition data. Users interact with the

typically do not interact directly language (DDL) and data database through these views,
manipulation language (DML) to which can simplify complex
with this level of abstraction.
create, retrieve, update, and queries and ensure data security
delete data. by limiting access to specific data
subsets.
Data Abstraction: Hiding Complexity
Conceptual Level Logical Level Physical Level

The conceptual level of data The logical level of data abstraction The physical level of data abstraction
abstraction provides users with a defines the structure and organization deals with the low-level, hardware-
high-level, simplified view of the of the data within the database, specific details of data storage and
database, hiding the complex internal including entities, attributes, and retrieval. This level is responsible for
structure and implementation details. relationships. This level represents the efficient and optimized storage
This abstraction allows users to focus the data in a way that is independent and access of data, leveraging
on the essential information and of the physical storage techniques like indexing, partitioning,
relationships, without getting bogged implementation, ensuring data and physical data structures.
down in the technical complexities. independence and flexibility.
Data Adminis trators (DBA)
Data Administrators (DBA) decide how to arrange data and where to store data. The Data Administrator (DBA) is the person
whose role is to manage the data in the database at the physical or internal level. There is a data center that securely stores the
raw data in detail on hard drives at this level.

The logical level or conceptual level is less complex than the physical level. With the help of the logical level, Data Administrators
(DBA) abstract data from raw data present at the physical level.
Achieving Data Independence
• Data independence can be explained using the three-schema architecture.
• Data independence refers characteristic of being able to modify the schema at one level of the database system without altering the
schema at the next higher level.

1 Logical Data Independence


Logical data independence ensures that changes in the logical structure of the database (such as adding, modifying, or deleting
entities and attributes) do not affect the applications that use the data. This allows for the evolution of the database schema without
disrupting the existing applications.

2 Physical Data Independence


Physical data independence enables changes in the physical storage implementation (such as the underlying hardware, file
organization, or access methods) without affecting the logical structure or the applications that use the data. This allows for
optimizations and improvements in the physical infrastructure without impacting the higher-level database operations.

3 The Benefits of Data Independence


Data independence enhances the flexibility, scalability, and maintainability of database systems. It enables the separation of
concerns between the logical data model and the physical storage implementation, allowing for seamless updates, upgrades, and
migrations without disrupting the existing applications and user experience.
Data Definition L anguage (DDL )
· The DDL is used for creating tables, indexes, constraints, and schema in the Database. Its used for define the database’s internal structure and
Pattern of the Database.

1 CREATE 2 ALTER 3 DROP


The CREATE statement in the Data The ALTER statement in DDL allows The DROP statement in DDL is used to
Definition Language (DDL) is used to for the modification of existing remove existing database objects,
define new database objects, such as database objects. This includes such as tables, indexes, and views,
tables, indexes, and views. It specifies adding, deleting, or modifying columns, from the database. This is often used
the structure, data types, and constraints, and other properties of for housekeeping and maintenance
constraints for these objects, laying the tables, indexes, and views, enabling purposes, as well as during schema
foundation for the database schema. the evolution of the database schema redesign and refactoring efforts.
over time.

4 TRUNCATE
The TRUNCATE statement in DDL is a specialized command that quickly removes all data from a table, while preserving the table structure.
This is useful for clearing large datasets or resetting a table to its initial state, without the need to drop and recreate t he table.
Data Manipulation Language (DML)
Its used to Manipulate the data in the database by using different commands. In this category we can able to perform Insert new data into Table,
Update existing data in the Table, Delete Data from the Table

INSERT UPDATE DELETE


The INSERT statement in the Data The UPDATE statement in DML is used to The DELETE statement in DML is used to
Manipulation Language (DML) is used to modify existing data records in a table. It remove existing data records from a
add new data records to a table. It allows users to change the values of one table. It allows users to selectively
specifies the values for each column in or more columns for a specific set of remove rows from a table based on
the table, allowing users to populate the rows, enabling the updating and specified conditions, enabling the
database with new information. refinement of data within the database. removal of obsolete or unwanted data
from the database.

SELECT
The SELECT statement in DML is the primary means of retrieving data from a database. It allows users to specify the desired columns, filter
and sort the data, and combine information from multiple tables, facilitating the extraction of relevant information for analysis and reporting.
Data Manipulation with SQL

SELECT FROM WHERE


The SELECT statement is The FROM clause in a The WHERE clause in a
the core of SQL's data SELECT statement SELECT statement
manipulation capabilities, identifies the table(s) from enables the filtering of
allowing users to specify which the data will be data, allowing users to
the columns they want to retrieved, forming the specify conditions that
retrieve from one or more foundation of the data must be met for a row to
tables. source. be included in the result
set.
Common Data Manipulation Operations

Ins erting Data Updating Data


Inserting new records into a table is a fundamental operation Modifying existing data records is essential for keeping
in data manipulation, allowing users to add fresh information information up-to-date and accurate, enabling users to refine
to the database. and correct stored data.

Deleting Data Joining Data


Removing obsolete or unwanted data records is necessary Combining data from multiple tables based on related
for maintaining the integrity and relevance of the database, information is a powerful technique for deriving meaningful
ensuring that only the most current and useful information is insights and establishing connections between different data
stored. sources.
Exploring the Entity-Relationship Model
1 Entities
In the Entity-R elationship (ER) model, an entity represents a distinct object or concept that is to be stored in the database. E ntities
can be physical (e.g., a customer, a product) or abstract (e.g., an order, a transaction).

2 Attributes
Attributes are the characteristics or properties that define an entity. Each entity has a set of attributes that describe its essential
features, such as a customer's name, address, and phone number, or a product's price, description, and SKU.

3 Relationships
Relationships in the ER model represent the meaningful connections between entities. These relationships can be one-to-one, one-
to-many, or many-to-many, and they are crucial for capturing the inherent associations within the database, such as a customer
placing an order or a product belonging to a specific category.
Entity-Relationship Models
Identifying Entities Defining Attributes Establishing Relationships

The first step in designing an E R Once the entities are identified, the Relationships between entities are
model is to identify the key entities next step is to define the relevant crucial for capturing the meaningful
that will be represented in the attributes for each entity. Attributes connections and dependencies within
database. This involves analyzing the should capture the essential the database. Careful analysis is
problem domain, understanding the characteristics and properties of the required to determine the appropriate
business requirements, and entity, providing the necessary relationship types (one-to-one, one-
determining the essential objects or information to fulfill the database's to-many, many-to-many) and ensure
concepts that need to be stored and requirements. that the overall E R model reflects the
managed. real-world associations.
L everaging the Power of the ER Model
Flexibility The ER model provides a flexible and extensible framework for
designing databases, allowing for the representation of diverse data
structures and the evolution of the schema over time.

Clarity The visual and conceptual nature of the ER model makes it easier
for stakeholders, developers, and database administrators to
understand and communicate the data relationships and structure.

Efficiency By capturing the inherent associations between entities, the ER


model enables more efficient data storage, retrieval, and
manipulation, optimizing the overall performance and functionality of
the database system.

Scalability The ER model's ability to accommodate complex data structures


and relationships makes it well-suited for handling the growing
demands of modern data-driven applications, ensuring scalability
and adaptability.

You might also like