0% found this document useful (0 votes)
20 views22 pages

FALL 2024 DB Session 1-1

Uploaded by

ziadis29204
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)
20 views22 pages

FALL 2024 DB Session 1-1

Uploaded by

ziadis29204
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/ 22

FALL 2024

Database

session
1

By:
Marwan Gaber
Data:
- Data is rows and figures that doesn’t have meaning of
itself
- It represents facts but with no meaning of each other
just data
Information:
- After the data be processed the information come
Ex:
The student data alone cant make anything but if we
process the data we will gain information about the
student .
Entity:
- It represents a real world object or concept (e.g.
employee )
Attributes:
- It represents some property of inserts that describes the
entity
Relationship:
- It is among two or more entities
ex: works-for relationship between the employee and
the department
Here we will know what is the information management
and why we don’t use it and what is the best replacement
of it:
Information management:
- information management is about gathering , organizing,
storing and sharing information they need at the right
time to make decisions
ex: A retail company tracks its weekly sales numbers.
By managing this data well, it can quickly see trends, like
which products are most popular, and decide which
items to stock up on for the following week.
Key concepts of information management:
1- Data Collection: Gathering data from places like internal
systems, outside databases, or user input.
2- Data organization: Structuring the data so it’s easy to
access, often using databases or data warehouses. 3-
Data storge: Selecting secure storage options like
relational databases or cloud storage to keep data safe
and accessible.
4- Data analysis: Using tools to analyze data and gain
insights that help in making decisions.
5- Information Dissemination: Sharing information with
stakeholders through reports, dashboards, or other
formats.
Information management process:
1- Identification
2- Acquisition
3- Storge
4- Processing
5- Distribution
6- Archiving and disposal

Principles of information management:

1-
Accuracy: means ensuring data is correct, consistent,
and free of errors. It is crucial because inaccurate
information can lead to poor decisions and negative
outcomes.
To achieve accuracy:
1- Pay attention to detail during data entry to avoid
mistakes.
2- 2-Use validation processes to confirm the data is
correct.
3- Perform regular audits to catch and correct any
inconsistencies or errors.
Methods to improve accuracy include:
1- Automating data entry to minimize human error.
2- Using advanced document processing systems to
capture data accurately.
3- Validating data from multiple sources to ensure
consistency.
2- Completeness: means gathering all necessary
information to avoid gaps or missing details, ensuring
that data provides a full picture for analysis and
decision-making
3- Timeliness:
- means providing up-to-date information promptly so
that decision-makers have what they need when they
need it.
- If information is outdated, it can lead to poor decisions
and missed chances, which could have serious negative
impacts on the business.
4- Relevance:
- means providing the right information that aligns with
the organization’s goals and objectives
- it ensures that the appropriate information is delivered
to the right person at the right time and place. - Focusing
on relevant information helps organizations make
informed decisions that directly support their business
objectives.
Example:
A company’s sales team needs up-to-date sales figures
and customer feedback to adjust their strategies, while
the HR department requires employee performance
data to make staffing decisions. By delivering specific,
relevant information to each department, the
organization ensures that every team has the necessary
data to achieve their goals effectively.

5- Accessibility:
- ensures that information is available to authorized
personnel whenever and wherever they need it,
whether in the office or remotely.
- Organizations must have secure, reliable systems that
allow easy access while maintaining document
security.
6- Security:
- involves protecting information from unauthorized
access, modification, or destruction. Given the risks of
cyber threats and data breaches
Example:
A financial institution encrypts client data and restricts
access to only those employees who need it. This
prevents unauthorized individuals from accessing
sensitive information, even if they gain access to the
system.

7- Integrity:
- ensures that the data in a database remains accurate,
consistent, and trustworthy. It protects information
from unauthorized or accidental changes, maintaining
its original form.
To ensure data integrity:
1. Implement Strong Controls
2. Use Validation Rules
3. Data Audits and Backups

Drawback of using file system to store data:


1- Duplication/Redundancy
- The same data may be stored in multiple files, leading to
wasted space.
Example: A person’s address stored in multiple files. If
it’s updated in one file but not the others, data
inconsistencies can occur.
2- Inconsistency
- Data may be stored in different formats or have
different names across files, making updates
inconsistent.
- Effect: increases development and maintenance time

3- Program-Data Dependence
- In file systems, data structures are embedded in the
code, meaning any change to the data requires updating
all related programs.
- Effect: Increases development and maintenance time.

4- Integrity Problems
- Data rules (like “balance > 0”) are embedded in the
code, making it hard to enforce or change them.

5- Atomicity Issues
- If an update fails partway, data may be left incomplete.
Example:
A fund transfer should either complete fully or not at all,
otherwise, accounts may show incorrect balances.

6- Concurrent Access Issues


- Multiple users accessing data simultaneously can cause
inconsistencies without proper control.
Example:
two users updating the same data at the same time.
7- Security Problems
- File systems lack the built-in security features of
database systems, making data more vulnerable.
The solution of these all is a DATABASE SYSTEM

BUT THE DATABASE:

Database:
- It is a collection of logically related data stored in a
single repository called Database Management System
(DBMS)
- DBMS manages interaction between end users and
database
Example:
bank and its ATM machines
Effectiveness vs. Efficiency:
- Effectiveness: is about doing the right things to achieve
high-quality results
Example:
A company sets a goal to increase customer
satisfaction. If the company successfully achieves that
goal, the process is effective.
- Efficiency: is about doing those right things in the right
way, using the least amount of time, money, and
resources to achieve the desired results.
Example:
If the same company can increase customer
satisfaction while reducing the cost or time spent on the
process, they have improved their efficiency.

⇨Productivity = Effectiveness + Efficiency

DBMS functionality:
1- Define Database: allows users to define a database by
specifying the data types, structures, and constraints. 2-
Construct or load database: When you create a new
database, the DBMS sets up the physical storage and
organizes the data so it can be efficiently stored and
retrieved.
3- Manipulate database: provides tools for querying,
inserting, deleting, and modifying EX: SQL language
4- Concurrent processing and sharing: ensures that
multiple users and programs can access the database
simultaneously while maintaining data consistency and
validity

Database System
- It is an integrated system of hardware, software ,
people , procedures and data

Procedures
⇨They are a functions , roles and instructions of a system
admin in database
Procedures includes many rules like:
1- Login to the DBMS
2- Start and stop the DBMS
3- Handling hardware and software failures
4- Backup copies of the database
Other functions of a system administrator:
1- OS Management
2- Network management
3- Server hardware management
4- Disk space monitoring
5- Upgrading memory
6- System backup and restoration

Database Standers : are best practices that keep the


database environment organized and running smoothly.
1- Installation and Testing
2- Upgrades
3- Bug Fixes and Maintenance
4- Interfaces
5- Storage and Monitoring
⇨These standers help maintain a reliable , secure and
efficient database system for everyone in the
organization
lets talk about the database system software - Users
interacts with database with query languages - Query
languages:
- Define the structure of the database for the data
- Allows the speedy retrieval and modification data
- Data definition for the database schema
- Data manipulation for data retrieval and update

Data Model:
⇨It describes the way that the data is organised and how
to represent the relationships among database records
⇨The relationship among many individuals based on one
of several models:
1- Hierarchical Model
2- Network Model
3- Relational Model
4- Entity-Relationship (ER) Data Model
5- Object oriented model
6- Object relational model
1 , 2 , 3 => Record based data models
5 , 6 => object based data model
1- Hierarchical Model (one-to-many)
- Database records are arranged in the form of tree with
several roots (children)

- The root represents the primary key and this paths is the
paths that can be passed
- Relationship among the record is one to many this
means that each parent can have many children but the
children has only one parent

- Ex1:

EX2:

2- Network Model (Many-to-one)


- The entity represented as a record type and record
represents the entity instance
- Many-to-Many (M:N) => each owner can have multiple
members and the member may have several owners

3- Relational Model
- Stores the data in the form of table
- Each table has rows and columns
- Each table has one or more columns that contain the
key of the table
- A single database can has multiple tables
- Relationships representation through common links .

Advantages
1- Data independence: The design of the database is
separate from the way data is stored. Changes in table
structure don’t affect data access or applications
2- Logical structure: Data is stored in tables, a logical setup
that’s easy for users to understand and use.
3- Simplified design and management : Relational
databases are easier to design, manage, and use. 4-
Flexible queries with SQL : SQL allows users to retrieve
data by stating what they need, not how to get it. 5-
Simplify and power : The model is conceptually simple
but powerful for managing data.
Disadvantages
1- High system requirements : Requires significant
hardware and software resources due to hidden
complexities and storage details.
2- Risk of poor design : The ease of use can lead to sloppy
design if not carefully managed.

Main characteristics of Database approach:


1- Self-describing system : DBMS includes a data
dictionary, which stores details about the database's
structure, like data types, relationships, and constraints.
This feature helps DBMS work with various databases.

2- Program-data independence : Unlike traditional file


systems, DBMS keeps data structure separate from
application code. This means you can change data
structures without needing to modify every related
program, a feature called program-data independence.

3- Data abstraction : DBMS hides storage details and gives


users a simplified view of data through data models,
making it easier to work with complex data structures.

4- Reduce data redundancy : DBMS follows rules


(normalization) that minimize data duplication, leading
to more consistent and accurate information

5- Powerful query language : DBMS provides a query


language, often SQL, allowing users to retrieve and
manipulate data easily with filtering and sorting
options
6- ACID properties : DBMS supports Atomicity,
Consistency, Isolation, and Durability (ACID) to ensure
data reliability and accuracy, even during errors or
crashes

7- Multiuser ad concurrent access : DBMS allows multiple


users to access and modify data simultaneously,
handling any conflicting changes behind the scenes to
ensure smooth operations

8- Data sharing and multiuser transactions : Users can


access only the specific data they need through tailored
views, ensuring that each role sees only relevant
information, e.g., a doctor sees patient health data,
while a billing clerk sees billing information

9- Multiple data view : Users can access only the specific


data they need through tailored views, ensuring that
each role sees only relevant information, e.g., a doctor
sees patient health data, while a billing clerk sees billing
information

10- Enhanced security : DBMS offers various security


levels so that users can have specific access rights. For
instance, one user might have read-only access, while
another can edit data, ensuring data protection across
departments
Advantages of using database Approach
1- Reduce redundancy : Centralized databases eliminate
duplicate data across departments, saving storage
space and preventing unnecessary repetition

2- Improved consistency : By reducing redundancy,


databases avoid inconsistencies caused by duplicate
data not being updated across systems

3- Data integrity : Databases ensure accurate data by


enforcing rules like:
1- Uniqueness : Each employee must have a unique ID
2- Relationships : Employees must be linked to valid
departments

4- Efficient Query Processing : indexes and other


storage structures improve the speed of retrieving
and managing data

5- Backup and Recovery : Databases offer systems to


back up data and restore it after failures, ensuring
reliability

6- Multiple User Interfaces : Different users, like


admins, analysts, or developers, can access data
through tailored interfaces

7- Reduce application development time

8- Flexibility to change data structure


Schema
- A schema is a blueprint or description of a database,
designed during its creation.
- It defines:
⇨Entities (objects like tables).
⇨Relationships (how entities are
connected). ⇨Constraints (rules the data
must follow)
- In relational databases, the schema is represented by
tables
- A schema diagram visually displays:
⇨The tables (relations).
⇨Attributes (columns in tables).
⇨Primary keys and foreign keys.
- Database designers create schemas to help
programmers understand the structure and effectively
use the database

There are three schema architectures:


1- External schema
2- Conceptual schema
3- Physical / internal schema
External schema
- Represents the views of different user groups, showing
only the part of the database relevant to them - Hides
irrelevant data for each user group
- Example
⇨A doctor sees only patients' medical data
⇨A billing clerk sees hospital bills but not medical details

Conceptual schema
- Describes the overall structure of the database:
Entities, attributes, relationships, and constraints -
Serves as a unified view of the entire database,
independent of physical storage.
- Example
⇨Entities: Customers, Orders
⇨Relationships: A customer can place multiple orders -
Often represented using an Entity-Relationship Diagram
(ERD)

Physical/Internal Schema
- Defines how data is stored on physical media (like hard
drives)
- Optimizes data storage and retrieval
- Techniques:
⇨Unsorted files
⇨sequential files
⇨indexing (e.g., ISAM, B+-trees)
⇨hashing

Data independence
1- Logical data independence:
- Ability to modify the conceptual schema without
affecting external schemas or application programs -
Use Cases:
⇨Adding/removing data items or tables.
⇨Changing relationships.

2- Physical Data Independence:


- Ability to change the physical storage without affecting
the conceptual or external schemas.
- Use Cases:
⇨Changing indexing methods or storage formats.
⇨Adopting new storage devices.
Database Administrator (DBA)
- Key Responsibilities:
⇨Authorizing access to the database.
⇨Monitoring database usage and performance.
⇨Resolving issues and tuning the system.
⇨Ensuring security by creating user profiles and enforcing
policies.
⇨Managing software licenses, tools, and hardware
maintenance.

Database Administrator functions


- Defining database schemas and storage structures (e.g.,
sequential files, hash files).
- Specifying access methods like indexing or hashing. -
Modifying schema and physical organization as needed. -
Setting up user permissions for accessing specific parts of
the database.
- Defining and enforcing data integrity rules (e.g., max
weekly work hours for employees).
- Acting as a link between users and the database system. -
Continuously monitoring performance and adapting to
new requirements.

Database Designer
- Design the database structure
- Responsibilities:
⇨Define entities, relationships, constraints, and user
views.
⇨Ensure the database supports required functions and
transactions
Application programmers
- Write programs to interact with the database -
Develop user-friendly applications that enable
interaction with the database

Database User
- End Users (Naïve Users)
⇨Use pre-written applications (e.g., bank clerks, online
shoppers).
- Casual/Sophisticated Users
⇨Access the database using query languages or tools like
data analysis software.

Database data model


- It describes:
- Structure: How data is organized (data types,
relationships).
- Operations: How to retrieve and update data.
- Constraints: Rules to maintain data integrity,
consistency, and validity
Example:
- Primary Key: Ensures each record is unique.
- Foreign Key: Links data between tables.
- Unique: No duplicate values.
- check: Restricts data to specific rules (e.g., age > 18).

Conceptual Data Model


• Purpose: Shows what the system contains without

technical details.
• Key Features:

o Entities: Objects (e.g., Student, Course).

o Attributes: Properties of entities (e.g., StudentID,

CourseName).
o Relationships: Connections between entities (e.g.,

A Student takes a Course).


• Example: Entity Relationship Diagram (ERD).
Thanks
Any Questions

You might also like