0% found this document useful (0 votes)
11 views61 pages

Week 2

Uploaded by

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

Week 2

Uploaded by

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

WEEK 2

IRFAN BANGASH
KOHAT UNIVERSITY OF SCIENCE AND TECHNOLOGY HANGU CAMPUS
ADVANTAGES OF DBMS

• A Database Management System (DBMS) offers


numerous advantages that enhance data
management, security, and accessibility within
organizations. Here are some of the key benefits of
using a DBMS
1. DATA INTEGRITY AND CONSISTENCY

• Enforcement of Rules: A DBMS enforces data


integrity constraints (such as primary keys, foreign
keys, and unique constraints) to ensure that the
data remains accurate and consistent across the
database.
• Validation: It validates data before it is entered
into the database, reducing the chances of errors
and inconsistencies.
2. IMPROVED DATA SECURITY

• Access Control: A DBMS provides robust security


features, including user authentication and role-
based access control, ensuring that only
authorized users can access or modify sensitive
data.
• Data Encryption: Many DBMSs support data
encryption, protecting data at rest and in transit
from unauthorized access.
3. EFFICIENT DATA MANAGEMENT

• Centralized Data Storage: A DBMS centralizes


data storage, making it easier to manage and
maintain large volumes of data.
• Data Retrieval: It provides efficient querying
capabilities, allowing users to retrieve data quickly
using structured query languages (e.g., SQL).
4. DATA SHARING AND COLLABORATION

• Multi-User Access: A DBMS allows multiple users


to access and work with the same data
simultaneously, facilitating collaboration among
teams and departments.
• Data Consistency Across Applications: By
providing a single source of truth, a DBMS ensures
that all applications accessing the data are working
with the same information.
5. BACKUP AND RECOVERY

• Automated Backups: A DBMS typically includes


features for automated data backup, ensuring that
data can be restored in case of hardware failures,
data corruption, or other disasters.
• Recovery Mechanisms: It provides recovery
mechanisms to restore data to a consistent state
after a failure, minimizing data loss.
6. DATA INDEPENDENCE

• Logical and Physical Data Independence: A


DBMS allows changes to be made to the database
structure (schema) without affecting the
applications that use the data. This separation
simplifies maintenance and development.
7. REDUCED DATA REDUNDANCY

• Normalization: A DBMS uses normalization


techniques to minimize data redundancy, ensuring
that data is stored efficiently and reducing the
chances of inconsistencies.
• Centralized Data Management: By centralizing
data storage, a DBMS reduces the need for
duplicate data across different applications.
LEVELS OF DATA

• In the context of data management and database


systems, data can be organized and understood at
different levels. These levels help in structuring
data, ensuring data integrity, and facilitating
efficient data retrieval and manipulation. Here are
the primary levels of data:
1. BIT LEVEL

• Definition: The most fundamental level of data,


representing the smallest unit of data in a
computer system. A bit can have a value of either
0 or 1.
• Characteristics: Bits are used to represent binary
data, which is the basis for all digital data storage
and processing.
2. BYTE LEVEL

• Definition: A byte consists of 8 bits and is the


basic unit of data storage in computer systems. It
can represent 256 different values (from 0 to 255).
• Characteristics: Bytes are commonly used to
represent characters in text (e.g., ASCII encoding)
and are the building blocks for larger data types.
3. FIELD LEVEL

• Definition: A field is a single piece of data or


attribute that represents a specific characteristic of
an entity. For example, in a customer database,
fields might include "Customer ID," "Name,"
"Email," and "Phone Number."
• Characteristics: Fields are defined by their data
types (e.g., integer, string, date) and constraints
(e.g., unique, not null).
4. RECORD LEVEL

• Definition: A record is a collection of related fields


that together represent a single entity or instance.
For example, a record in a customer database
might include all the fields related to a specific
customer.
• Characteristics: Records are often organized in
rows within a table in a relational database.
5. FILE LEVEL

• Definition: A file is a collection of related records


stored together. For example, a customer file might
contain all records of customers in a business.
• Characteristics: Files can be structured (e.g.,
databases) or unstructured (e.g., text documents,
images).
6. DATABASE LEVEL

• Definition: A database is a structured collection of


related files that are managed by a Database
Management System (DBMS). It contains multiple
tables, each consisting of records and fields.
• Characteristics: Databases support relationships
between tables, allowing for complex queries and
data manipulation.
7. DATA WAREHOUSE LEVEL

• Definition: A data warehouse is a centralized repository


that stores large volumes of historical data from
multiple sources. It is designed for analysis and
reporting rather than transaction processing.
• Characteristics: Data warehouses support complex
queries and data analysis, often using techniques like
data mining and online analytical processing (OLAP).
8. DATA LAKE LEVEL

• Definition: A data lake is a storage repository that holds


vast amounts of raw data in its native format until it is
needed for analysis. It can store structured, semi-structured,
and unstructured data.
• Characteristics: Data lakes are designed for big data
analytics and can accommodate a wide variety of data
types, making them suitable for data scientists and analysts.
9. METADATA LEVEL

• Definition: Metadata is data about data. It


provides information about other data, such as its
source, format, structure, and relationships.
• Characteristics: Metadata helps users
understand the context and meaning of the data,
making it easier to manage and retrieve.
DATABASE USERS

• Database users are individuals or applications that


interact with a database management system (DBMS)
to perform various operations such as data entry,
retrieval, modification, and management. Different
types of users have different roles and responsibilities
when it comes to interacting with databases. Here are
the main categories of database users:
1. DATABASE ADMINISTRATORS (DBAS)

• Role: DBAs are responsible for managing and maintaining the


database system. They ensure that the database is secure,
available, and performing optimally.
• Responsibilities:
• Installing and configuring the DBMS.
• Managing user access and permissions.
• Performing backups and recovery operations.
• Monitoring database performance and tuning.
• Implementing security measures to protect data.
2. APPLICATION DEVELOPERS

• Role: Application developers create software applications


that interact with the database. They design the application
logic and user interfaces that allow users to access and
manipulate data.
• Responsibilities:
• Writing code to connect to the database and execute queries.
• Designing database schemas and structures.
• Implementing data validation and business logic.
• Ensuring that applications are efficient and user-friendly.
3. END USERS

• Role: End users are individuals who use applications that interact
with the database to perform their tasks. They may not have
technical knowledge of the database but rely on it for their work.
• Types of End Users:
• Casual Users: Use the database occasionally for specific tasks (e.g.,
generating reports).
• Power Users: Have more advanced knowledge and use the database
frequently for complex queries and data analysis.
.

• Responsibilities:
• Entering and updating data.
• Retrieving and analyzing data through
applications.
• Generating reports and visualizations.
4. DATA ANALYSTS AND DATA
SCIENTISTS
• Role: Data analysts and data scientists focus on analyzing
data to extract insights and support decision-making. They
often use statistical and analytical tools to work with data.
• Responsibilities:
• Writing complex queries to retrieve and analyze data.
• Performing data mining and statistical analysis.
• Creating visualizations and reports to communicate findings.
• Collaborating with other teams to understand data needs.
5. SYSTEM ANALYSTS

• Role: System analysts work to understand the requirements


of the organization and design systems that meet those
needs. They often act as a bridge between end users and
developers.
• Responsibilities:
• Gathering and analyzing user requirements.
• Designing system specifications and workflows.
• Collaborating with developers to ensure that the database meets
user needs.
6. DATABASE DESIGNERS

• Role: Database designers are responsible for designing the


database schema and structure. They ensure that the
database is efficient, scalable, and meets the requirements of
the organization.
• Responsibilities:
• Defining tables, fields, relationships, and constraints.
• Normalizing data to reduce redundancy.
• Creating data models and documentation.
7. BUSINESS USERS

• Role: Business users are individuals who use the database to


support business operations and decision-making. They may not
have technical expertise but rely on data for their roles.
• Responsibilities:
• Using business intelligence tools to access and analyze data.
• Making data-driven decisions based on reports and insights.
• Collaborating with IT and data teams to ensure data needs are met.
DATABASE ADMINISTRATOR?

• A Database Administrator (DBA) is a specialized


IT professional responsible for managing,
maintaining, and securing an organization's
databases. The role of a DBA is critical in ensuring
that databases operate efficiently, securely, and
reliably, supporting the data needs of the
organization
RESPONSIBILITIES OF A DATABASE
ADMINISTRATOR

1.Database Installation and Configuration:


1.Install and configure database management systems
(DBMS) such as Oracle, MySQL, Microsoft SQL Server, or
PostgreSQL.
2.Set up database instances and configure parameters for
optimal performance.
2 DATABASE DESIGN AND
IMPLEMENTATION:

• Design database schemas, including tables,


relationships, and constraints, to meet the data
requirements of applications.
• Implement normalization and denormalization
techniques to optimize data storage and retrieval.
3 PERFORMANCE MONITORING AND
TUNING:

• Monitor database performance using various tools


and techniques.
• Identify and resolve performance bottlenecks by
optimizing queries, indexing strategies, and
database configurations.
4 BACKUP AND RECOVERY

1.Develop and implement backup strategies to ensure


data is regularly backed up and can be restored in case
of data loss or corruption.
2.Perform recovery operations to restore databases to a
consistent state after failures.
5 SECURITY MANAGEMENT:

1.Implement security measures to protect


sensitive data, including user authentication,
access controls, and encryption.
2.Regularly audit database security and
compliance with organizational policies and
regulations.
6 USER MANAGEMENT:

1.Create and manage user accounts, roles, and


permissions to control access to the database.
2.Provide support and training to users on database
access and usage.
7 DATA MIGRATION AND INTEGRATION:

1.Plan and execute data migration projects, moving data


between different databases or systems.
2.Integrate databases with other applications and
systems to facilitate data sharing and reporting.
8 TROUBLESHOOTING AND SUPPORT:

• Diagnose and resolve database-related issues,


including performance problems, data corruption,
and connectivity issues.
• Provide technical support to developers and end-
users regarding database queries Aand operations.
9 DOCUMENTATION AND REPORTING:

1.Maintain documentation related to database


configurations, procedures, and policies.
2.Generate reports on database performance, usage, and
security for management review.
DATA MODEL AND DBMS

• A data model and a Database Management


System (DBMS) are two fundamental concepts in
the field of data management and database
design.
DATA MODEL

• Definition: A data model is a conceptual


representation of the data structures,
relationships, and constraints within a database.
It defines how data is organized, stored, and
manipulated, providing a framework for
understanding and designing databases.
COMPONENTS OF A DATA MODEL

Entities:
1.Objects or things in the real world that have a
distinct existence. For example, in a university
database, entities might include "Student,"
"Course," and "Instructor."
2 ATTRIBUTES:

1.Characteristics or properties of entities. For


example, a "Student" entity might have
attributes such as "Student ID," "Name," "Date
of Birth," and "Email."
3 RELATIONSHIPS:

1.Connections between entities that define how


they interact with each other. For example, a
"Student" may be enrolled in multiple
"Courses," establishing a relationship between
the two entities.
4 CONSTRAINTS:

1.Rules that govern the data, ensuring data integrity and


consistency. Examples include primary keys (unique
identifiers for records), foreign keys (references to
primary keys in other tables), and data type constraints.
TYPES OF DATA MODELS

1.Conceptual Data Model:


1.A high-level representation of the data, focusing on the
overall structure and relationships without getting into
technical details. It is often used in the initial stages of
database design.
2 LOGICAL DATA MODEL:

1.A more detailed representation that defines the


structure of the data in a way that is independent of any
specific DBMS. It includes entities, attributes, and
relationships but does not specify how the data will be
physically stored.
3 PHYSICAL DATA MODEL:

1.A representation that describes how the data will be


stored in the database, including details about tables,
indexes, data types, and storage structures. It is specific
to a particular DBMS.
4 HIERARCHICAL DATA MODEL:

1.Organizes data in a tree-like structure, where


each record has a single parent and can have
multiple children. This model is less common
today but was used in early database systems.
5 NETWORK DATA MODEL:

1.Similar to the hierarchical model but allows more


complex relationships, where a record can have multiple
parents. This model is also less common today.
6 RELATIONAL DATA MODEL:

1.Represents data in tables (relations) with rows and


columns. It is the most widely used data model today
and forms the basis for relational database
management systems (RDBMS).
RELATIONSHIP BETWEEN DATA MODEL AND DBMS

• Foundation for DBMS: The data model serves as the foundation for the
design and implementation of a database within a DBMS. It defines how data
is structured and related, guiding the creation of tables, relationships, and
constraints in the DBMS.
• Implementation of Data Models: A DBMS implements the concepts
defined in the data model, allowing users to create, manage, and manipulate
data according to the rules and structures established by the model.
• Support for Multiple Data Models: Many modern DBMSs support various
data models, including relational, document-oriented, and graph models,
allowing organizations to choose the most appropriate model for their data
needs.
THE THREE LEVEL OF ARCHITECTURE
EXTERNAL , CONCEPTUAL AND INTERNAL
LEVELS
• The three-level architecture of a database system is
a framework that helps to separate the user
applications and the physical database. This
architecture is designed to provide data abstraction
and independence, allowing changes to be made at
one level without affecting other levels.
1. EXTERNAL LEVEL (VIEW LEVEL)

• Definition: The external level is the highest level


of abstraction in the database architecture. It
defines how users interact with the data and
presents different views of the database tailored to
specific user needs.
CHARACTERISTICS:

• User -Specific Views: Each user or user group can have a


customized view of the data, which may include only the relevant
data they need to access. For example, a sales representative may
only see customer and order information, while a finance manager
may see financial data.
• Data Abstraction: The external level hides the complexities of the
underlying data structures and storage details, allowing users to
interact with the data in a more intuitive way.
• Multiple Views: A single database can have multiple external
views, each designed for different applications or user roles.
EXAMPLE:

• In a university database, the external view for


students might include their personal information,
course enrollments, and grades, while the external
view for faculty might include course details,
student lists, and grading capabilities.
2. CONCEPTUAL LEVEL (LOGICAL LEVEL)

• Definition: The conceptual level provides a


community view of the entire database. It defines
what data is stored in the database and the
relationships among those data. This level
abstracts the details of how the data is physically
stored.
CHARACTERISTICS:

• Unified View: The conceptual schema represents the entire database


structure, including entities, attributes, and relationships, without
concern for how the data is physically implemented.
• Data Independence: Changes made at the internal level (physical
storage) do not affect the conceptual level. This means that the logical
structure of the database can remain stable even if the underlying
storage changes.
• Data Integrity: The conceptual level enforces data integrity constraints,
such as primary keys and foreign keys, ensuring that the data remains
accurate and consistent.
EXAMPLE:

• In the university database, the conceptual level


would define entities such as "Student," "Course,"
and "Enrollment," along with their attributes (e.g.,
Student ID, Course Name) and relationships (e.g.,
students enroll in courses).
3. INTERNAL LEVEL (PHYSICAL LEVEL)

• Definition: The internal level is the lowest level of


abstraction in the database architecture. It
describes how the data is physically stored in the
database, including the data structures, file
organization, and access methods.
CHARACTERISTICS:

• Physical Storage: The internal schema defines the physical storage of


data, including how data is stored on disk, the data types used, and the
indexing methods employed for efficient data retrieval.
• Performance Optimization: This level focuses on optimizing the
performance of data access and storage, including considerations for data
compression, partitioning, and caching.
• Data Independence: Changes made at the internal level (e.g., changing
the storage format or indexing method) do not affect the conceptual level,
allowing for flexibility in how data is stored.
EXAMPLE:

• In the university database, the internal level might


specify that student records are stored in a specific
file format on disk, using B-trees for indexing to
speed up queries related to student IDs.

You might also like