0% found this document useful (0 votes)
13 views7 pages

Chapter 1 - Introduction To DB

Uploaded by

willdelete001
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)
13 views7 pages

Chapter 1 - Introduction To DB

Uploaded by

willdelete001
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/ 7

Chapter 1 - Introduction to DB

What is a Database?
A database is a collection of related data. This data can be stored in various formats, such as an
indexed address book or on a hard drive using software like Microsoft Access or Excel.
This collection of related data with an implicit meaning (‫ )معنى ضمني‬is a database.

Definition

A database is a structured collection of related data that holds implicit


meaning.

Implicit Properties of a Database


1. Representation of the Real World (Miniworld or Universe of Discourse (UoD)): ‫تمثيل جزء من‬
‫العالم الحقيقي‬
A database models a specific part of the real world. For example, an e-commerce database
might represent customers, products, and transactions. Any changes in this "miniworld"
(e.g., a customer buying a product) should be reflected in the database to maintain
accuracy.
2. Logically Coherent Collection of Data with Meaning: ‫مجموعة متماسكة منطقيًا‬
A database is not just random data; it is organized and structured in a way that reflects
logical relationships between pieces of information. This coherence provides context and
meaning, enabling useful querying and manipulation of the data. For example, customer
names might be linked to addresses and purchase histories, forming a meaningful structure.
3. Specific Purpose and Intended Use:
Databases are not generic but are designed for particular users or applications. Each
database is built with a goal in mind—whether for managing orders, tracking inventory, or
storing patient records. The design considers what the users need to do with the data (e.g.,
retrieve, update, analyze).

Disadvantages of File Based Systems


1. Separation and Isolation of Data:
Data scattered across systems and formats makes it hard to unify access and analysis,
leading to inefficiency.
2. Duplication of Data:
Duplicate records across different programs lead to data inconsistency (‫)عدم االتساق‬,
redundancy (‫)التكرار‬, and additional storage costs, complicating updates and maintenance.
3. Data Dependence:
The strong dependence on the physical structure of data files in the application code leads
to a lack of flexibility when changing the file structure, making updates difficult.
‫اعتماد البيانات يعني أن بنية الملفات المادية (مثل كيفية تخزين البيانات وتنظيمها) تكون مرتبطة مباشرة بالتطبيق الذي يستخدم‬
‫ فإن البرنامج الذي يستخدم هذا الملف يجب‬،‫ إذا تم تخزين البيانات في ملف معين بتنسيق أو هيكل معين‬،‫ بعبارة أخرى‬.‫هذه الملفات‬
‫أن يكون مكتوًبا خصيًص ا للتعامل مع هذا الهيكل‬.
4. Integrity Issues(‫)مشاكل السالمة‬:
There are no built-in mechanisms to enforce data constraints like unique IDs or value
ranges, which could lead to errors in critical data.

​Example: In a university file system, student records are stored in text files. If
two students are mistakenly assigned the same ID, the system won’t flag it,
leading to potential errors when processing grades or attendance.

5. All or Nothing:
Ensuring all parts of a transaction are completed (or none at all) is difficult, increasing the
risk of incomplete data updates.

​Example: ‫ ولكن النظام تعطل‬،‫ إذا كان المستخدم يحاول حجز تذكرة الطيران وقام بالدفع‬،‫في نظام حجز التذاكر‬
.‫ فقد يحدث أن يتم خصم المبلغ دون تأكيد الحجز‬،)‫قبل إتمام العملية بالكامل (مثًال قبل تحديث حالة الحجز في الملف‬
‫ وبالتالي تتعرض البيانات لحالة غير متسقة‬،‫ لم يحدث الحجز بشكل كامل‬،‫في هذا المثال‬.

6. Security Issues:
Managing who has access to which data becomes complex in a file-based system, making
it harder to enforce security measures or track actions.
7. Limited Data Sharing:
Most file-based systems restrict file access to a single user at a time, hindering
collaboration and real-time data access.

​Example: In a small business, two employees may need to update the same
inventory file at the same time. In a file-based system, only one can access
the file, while the other has to wait, slowing down work.

8. Disaster Recovery:
Without proper backup and recovery mechanisms, the system is vulnerable to data loss
during hardware or software failures.
Database management system (DBMS) ‫نظام إدارة‬
‫قواعد البيانات‬
A Database Management System (DBMS) is a collection of programs that helps users create and
manage a database. It provides general-purpose software functionalities, including:

1. Defining a Database:
This means specifying the types of data, how it is structured, and the rules for the data
(constraints). The information about the database structure is stored in the DBMS as
metadata (data about data), often in a catalog or dictionary.

​Example: A university database might be defined to include tables for


Students, Courses, and Enrollments. Each table specifies the data types
for its fields, such as:
Students: StudentID (int) , Name (varchar) , Email (varchar) , DateOfBirth
(date)
Courses: CourseID (int) , CourseName (varchar) , Credits (int)
Enrollments: EnrollmentID (int) , StudentID (int) , CourseID (int) , Grade
(varchar)

2. Constructing the Database:


This is the process of actually storing the data on a storage medium (like a hard drive) that
the DBMS controls.
3. Manipulating the Database:
This includes:
Querying (‫)االستعالم‬: Asking the database for specific data.
Updating (‫)التحديث‬: Making changes to the data to keep it accurate and up to date.
Generating Reports (‫)إنشاء التقارير‬: Creating summaries or detailed information from
the data.
4. Sharing a Database:
The DBMS allows multiple users and applications to access the database at the same time.

Important Functions of a DBMS


1. Protection of the Database
System Protection: The DBMS safeguards the database against hardware or software
malfunctions (crashes). For instance, if a server crashes, the DBMS helps recover data to
ensure that no information is lost.
Security Protection: It provides security measures to prevent unauthorized or malicious
access. For example, user authentication protocols ensure that only authorized personnel
can access sensitive data.
2. Long-Term Maintenance
Database Lifecycle Management: A typical large database can have a lifespan of many
years. The DBMS must support the evolution of the database system as requirements
change. This means adapting to new data types, structures, or user needs over time
without losing data integrity or availability.

Database Design and Implementation Process


1. Requirements Specification and Analysis: ( ‫) تحديد وتحليل المتطلبات‬
The IT department begins the process by gathering and documenting detailed requirements
for a new application or an existing database. This phase is crucial as it defines what the
system needs to achieve.
2. Conceptual Design: ( ‫) تحويل المتطلبات إلى تصميم‬
The documented requirements are transformed into a conceptual design. This design
represents the high-level structure of the data and its relationships. It can be manipulated
using specialized computerized tools to facilitate maintenance and modification.
For this purpose, a model known as the Entity-Relationship (ER) model is often used,
which will be introduced in more detail later (e.g., in Chapter 7).
3. Logical Design:
The conceptual design is then translated into a logical design. This design is expressed in
a data model that can be implemented using a commercial Database Management System
(DBMS).
The Relational Data Model is emphasized as it is currently the most popular approach for
designing and implementing databases. This model will be discussed further starting in
Chapter 3.
4. Physical Design:
During the physical design phase, additional specifications are provided regarding how the
database will be stored and accessed. This includes considerations for performance,
storage efficiency, and security.
The database design is then implemented, meaning the structure is created within the
DBMS, and it is populated with actual data.
5. Continuous Maintenance:
Once the database is implemented, it is continuously maintained to ensure that it reflects
the current state of the "miniworld" it represents. This means updating data as necessary,
modifying structures to accommodate new requirements, and ensuring the overall
integrity and performance of the system.
Example Illustration ( ‫) مثال توضيحي‬
Company Database: For a company managing employee information:
1. Requirements Gathering: The HR department specifies the need for tracking employee
details, salaries, and performance evaluations.
2. Conceptual Design: An ER model is created showing entities like Employees,
Departments, and Salaries, along with their relationships.
3. Logical Design: The ER model is translated into a relational schema, defining tables for
Employees and Departments with appropriate fields and keys.
4. Physical Design: Specifications for indexing, partitioning, and storage formats are provided
to optimize performance.
5. Implementation and Maintenance: The database is created in a DBMS like MySQL or
Oracle, filled with actual employee data, and regularly updated as employees join or leave
the company.

Database Management Roles


1. Database Administrators (DBAs)
Role and Responsibilities
Manage database resources and DBMS.
Control access and permissions.
Monitor usage for performance and security.
Handle security breaches and performance issues.

Example: A DBA in a hospital ensures only authorized staff can access patient
records.

2. Database Designers
Role and Responsibilities:
Identify and structure data.
Engage with users to gather requirements.
Develop tailored views for different user groups.

Example: An e-commerce designer creates a database for product information based


on team input.
3. End Users
Role: Interact with the database for querying, updating, and generating reports.
Categories of End Users
Casual End Users ( ‫) العاديون‬:
Access the database occasionally for different information.
Use sophisticated query languages.
Example: A manager checking sales reports.
Naïve or Parametric End Users ( ‫) المبتدئون أو المعامالت المحددة‬:
Regularly access the database using standard queries.
Examples:
Bank Tellers: Check balances and post transactions.
Reservation Agents: Check availability and make bookings.
Shipping Employees: Enter package data and update databases using barcode
scanners.
Sophisticated End Users ( ‫) المتقدمون‬:
Have a deep understanding of the DBMS and create their own applications.
Examples: Engineers and data scientists performing complex analyses.
Standalone Users ( ‫) المستقلون‬:
Use personal databases with ready-made software packages.
Example: A tax filer using tax software for personal data.

User Interfaces

Naive End Users: Minimal training; interact through user-friendly interfaces for standard
transactions.
Casual Users: Learn a few features for occasional use.
Sophisticated Users: Learn most features of the DBMS for complex requirements.
Standalone Users: Proficient in specific software packages.

4. System Analysts and Application Programmers (Software


Engineers)
Role and Responsibilities:
Understand user requirements.
Design applications to meet those needs.
Example: A system analyst interviews users to improve an application.

Application Programmers

Role and Responsibilities:


Implement specifications and conduct testing.

Example: An application programmer develops and tests a new accounting feature.

You might also like