0% found this document useful (0 votes)
4 views46 pages

Introduction To Database System

A database is an organized electronic collection of data that allows efficient storage, retrieval, and management of large amounts of structured information. Databases provide advantages such as data integrity, security, centralized management, and scalability, and they can be implemented through various models like relational, hierarchical, and network databases. Database Management Systems (DBMS) facilitate the creation and management of databases, with popular types including RDBMS, NoSQL, and specific systems like MySQL and Oracle.

Uploaded by

Hazrat Ullah
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)
4 views46 pages

Introduction To Database System

A database is an organized electronic collection of data that allows efficient storage, retrieval, and management of large amounts of structured information. Databases provide advantages such as data integrity, security, centralized management, and scalability, and they can be implemented through various models like relational, hierarchical, and network databases. Database Management Systems (DBMS) facilitate the creation and management of databases, with popular types including RDBMS, NoSQL, and specific systems like MySQL and Oracle.

Uploaded by

Hazrat Ullah
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

Introduction to

Database System.
What is database?
Introduction to Database.

• A database is an organized collection of data that is stored and


accessed electronically, typically through a computer system.
Databases are designed to efficiently store, retrieve, and manage
large amounts of structured data, and they can be used for a wide
range of applications, from business management systems to
websites and mobile apps.
Database.

Figure 1 Figure 2
Importance/Advantages of
Databases
• Databases offer numerous advantages and are crucial for managing large volumes of data
effectively. Here are some of the key importance and advantages of using databases:
1. Data Integrity and Accuracy
• Consistency: Databases enforce rules (through constraints like primary keys, foreign keys, etc.) that ensure

data integrity and reduce errors.


• Validation: Databases can automatically validate data to ensure it follows the required formats, types, or

ranges (e.g., an age cannot be negative).


• Avoids Redundancy: Databases reduce data duplication by organizing data efficiently and ensuring that each

piece of data is only stored once.


2. Efficient Data Storage and Retrieval
• Optimized Querying: Databases use indexing, caching, and other optimization techniques to quickly retrieve
data. For example, relational databases can perform complex queries in a fraction of a second.
• Structured Organization: Data is organized into tables, rows, and columns, making it easy to store and retrieve
specific data efficiently.
3. Data Security
• Access Control: Databases allow fine-grained control over who can access and modify the data, ensuring that

sensitive information is protected.

• Encryption: Data can be encrypted both at rest (when stored) and in transit (when being transferred), which

adds an extra layer of protection.

• Backups: Databases often support automatic backups, helping to recover data in case of hardware failure or

other disasters.
4. Centralized Data Management
• Single Source of Truth: A database serves as a central repository for data, ensuring
that everyone in an organization is working with the same up-to-date information.
• Collaboration: Multiple users can access and update the database simultaneously,
promoting collaboration while maintaining consistency.

5. Data Redundancy Elimination


• Normalization: Databases follow normalization principles to avoid data
redundancy and ensure that the data is stored in the most efficient way. This
reduces the chances of data inconsistency and reduces storage requirements.
6. Scalability
• Handling Large Volumes of Data: Modern databases are designed to handle increasing amounts of
data (scalability). Whether it’s more records, more users, or more complex queries, databases can
scale to meet the demand.
• Distributed Databases: In cloud environments or with NoSQL databases, data can be distributed
across multiple servers to handle vast amounts of data efficiently.

7. Data Backup and Recovery


• Automated Backups: Databases support regular backups and point-in-time recovery, so data can
be restored to a previous state in the event of accidental loss or corruption.
• Disaster Recovery: With proper backup strategies, a database ensures business continuity in case
of disasters (hardware failure, cyber-attacks, etc.).
Database Models.

• A database model defines the logical structure of a database and how


data is stored, accessed, and manipulated. There are several types of
database models, each suited to different kinds of applications and
use cases. Below are the main types of database models:
1. Relational Database Model
(RDBMS)
• This is the most widely used model, where data is stored in tables
(also called relations). Tables consist of rows (records) and columns
(attributes or fields). Relationships between data are established
through keys (primary and foreign keys).
1. Relational Database Model
(RDBMS)
• Key Features :
• Data is organized into tables.

• Tables are related to each other via keys.

• Uses SQL (Structured Query Language) for querying and managing data.

• Supports ACID properties (Atomicity, Consistency, Isolation, Durability) for


transactions.
Examples :

• MySQL, PostgreSQL, Oracle, Microsoft SQL Server, SQLite.


Use Case:

The Relational Model is widely used in database systems to organize and manage data. Here are key use cases where
the relational model proves highly effective.

1. Business Applications
• Customer Relationship Management (CRM):
• Managing customer information, sales, and interactions.
• Storing data such as customer IDs, names, orders, and transactions.

• Enterprise Resource Planning (ERP):


• Handling business operations like inventory, supply chain, and financial transactions.
• Example: Linking sales orders to inventory levels and financial records
Hierarchical Database Model.

• A Hierarchical Database Model is one of the earliest and simplest


types of database models. It organizes data in a tree-like structure,
where each record has a single parent and potentially many children.
This structure is suitable for representing data with one-to-many
relationships.
Key Features of the Hierarchical
Model:
• Tree-Like Structure:
• Data is organized in a hierarchy with nodes connected by links.
• The top node is called the root, and all other nodes are descendants.

• Parent-Child Relationship:
• Each child node has exactly one parent, but a parent can have multiple children.
• This relationship ensures strict one-to-many data associations.

• Data Access:
• Navigation is done through pointers or links between nodes.
• Traversal starts from the root and follows predefined paths.

• Performance:
• Fast data retrieval when queries follow the hierarchy.
• Efficient for scenarios like organizational charts or file systems.

•Data Redundancy:
• Limited flexibility and potential redundancy if the hierarchy is not well-defined.
Example Use Case:

• Organizational Structures:
• Representing a company's departments, employees, and their reporting
hierarchy.

• File Systems:
• Representing folders and files in a directory structure.
Example.
Network Database Model.

• A network database model is a type of database model designed to


handle many-to-many relationships efficiently. It represents data
using a graph-like structure where entities are represented as nodes,
and the relationships between them are represented as edges (or
links). This structure allows for more flexible and interconnected data
representation compared to hierarchical database models.
Key Features of Network Database Models:

• Graph-Based Representation:
• Entities (data records) are nodes.
• Relationships (associations) are edges.

• Many-to-Many Relationships:
• Unlike the hierarchical model, which enforces a strict parent-child relationship, the network model
allows an entity to have multiple parent and child relationships.

• Data Access via Pointers:


• Data in a network model is accessed through pointers (or navigational access paths) that link records.
Example of a Network Model:

• Consider a database for university management:

• Entities:
• Students, Courses, Professors.

• Relationships:
• Students can enroll in multiple courses (many-to-many).

• Each course can be taught by multiple professors (many-to-many).

• Professors may mentor multiple students (one-to-many).


Example of a Network Model:
Database Management System
(DBMS)
• A Database Management System (DBMS) is software that is used to
create, manage, and interact with databases. It provides an interface
for users and applications to access, manipulate, and store data in a
structured and organized way. The DBMS ensures that the data is
stored efficiently, securely, and can be easily retrieved, updated, or
deleted.
Types of DBMS:
• Hierarchical DBMS:
• Organizes data in a tree-like structure.
• Network DBMS:
• Organizes data in a graph-like structure with multiple parent nodes.
• Relational DBMS (RDBMS):
• Stores data in tables and supports SQL for querying (e.g., MySQL,
PostgreSQL).
• NoSQL DBMS:
• Designed for handling unstructured or semi-structured data, often used in big
data or real-time web applications (e.g., MongoDB, Cassandra)
Relational Database Management
System (RDBMS)
• A Relational Database Management System (RDBMS) is a type of
database management system (DBMS) that stores data in a structured
format, using rows and columns. It is based on the relational model,
which is a way of structuring data using relationships (usually tables).
Each of the mentioned SQL-based RDBMSs (MS Access, MS SQL,
MySQL, and Oracle) implement the relational model with slight
differences in features, performance, and scalability.
MS Access.

• MS Access is a desktop-based relational database system developed


by Microsoft. It is part of the Microsoft Office Suite and is
designed for small to medium-sized database applications. MS
Access allows users to create and manage databases, and it
provides an intuitive interface with drag-and-drop tools.
Key Features:
•Built-in forms, reports, and queries.
•Easy-to-use graphical user interface (GUI) for database design.
•Supports SQL, but also allows for queries via a graphical interface.
•Can integrate with other Microsoft products, such as Excel and Outlook.

• Use Cases:
• Small business applications.

• Prototyping and quick database creation.

• Personal databases or small-scale departmental databases.


MS SQL Server (Microsoft SQL
Server)

• MS SQL Server is a relational database management system developed by Microsoft. It


is designed for enterprise-level applications and offers high performance, scalability,
and robust security features.

• Key Features:
• Full-featured RDBMS supporting SQL, stored procedures, and triggers.

• Strong support for business intelligence tools, including integration with Microsoft Power BI.

• High availability features like replication, clustering, and Always On Availability Groups.

• Advanced security features such as encryption, auditing, and user access controls.
Use Cases:

• Enterprise-level applications with large databases.

• Data warehousing and business intelligence applications.

• Online transaction processing (OLTP) systems.


MySQL

• MySQL is an open-source relational database management system. It is one of the most popular
RDBMSs due to its open-source nature, ease of use, and speed. It is often used for web
applications and has wide support in the open-source community.

• Key Features:
• Open-source, with multiple forks and distributions (e.g., Maria DB).

• Supports SQL and ACID (Atomicity, Consistency, Isolation, Durability) properties for transactions.

• Lightweight, fast, and highly portable.

• Strong support for web development, often paired with PHP in LAMP (Linux, Apache, MySQL, PHP) stack.
Use Cases:

• Web applications, especially for dynamic websites.

• Content management systems (CMS) like WordPress, Joomla, and


Drupal.

• Small to medium-sized applications requiring fast, reliable databases


Oracle Database

• Oracle Database is a powerful and highly scalable relational database management system
developed by Oracle Corporation. It is used for large-scale, enterprise-level applications and
is known for its advanced features and high performance.
• Key Features:
• High performance, scalability, and robustness.

• Advanced features like Real Application Clusters (RAC) for high availability and scalability.

• Strong support for data warehousing, big data, and cloud computing.

• Comprehensive security features including data encryption and fine-grained access control.

• Extensive toolset including Oracle Data Guard, Oracle Flashback, and Oracle Enterprise Manager.
Use Cases

• Large enterprises with complex and mission-critical applications.

• Data warehousing and business intelligence.

• Cloud-based applications and high-performance computing.


Definition of Relational Database &
RDBMS
• Relational Database
• A Relational Database is a type of database that organizes data into tables
(also known as relations). Each table consists of rows (records) and columns
(fields), where:
• Rows represent individual records.

• Columns represent attributes or properties of the records.


Entity, Table, Record, Field

• Entity
• An entity represents a real-world object, concept, or thing that has attributes
(properties) and is stored in a database. For example, a "Student" or "Employee" can be
considered an entity

• . Table
• A table is a collection of data organized in rows and columns in a database. Each row
represents a single record, and each column represents a specific field or attribute of the
data. For example, a "Students" table may have fields like Name, Age, and Roll Number.
• Record
• A record is a single row in a table, representing one instance of an entity. For
example, in a "Students" table, a record could represent one student with
their specific details.

• Field
• A field is a column in a table that stores a specific type of data for all records.
For example, the "Name" field in a "Students" table stores the names of all
students.
Primary Key, Composite Key, Foreign
Key
• Primary Key
• A primary key is a field (or combination of fields) that uniquely identifies each record in a table.
It ensures that no two records have the same value for this field. Example: A "Student ID" field in
a "Students" table.

• Composite Key
• A composite key is a combination of two or more fields that together uniquely identify a record
in a table. It is used when no single field can uniquely identify a record. Example: In a "Classroom
Assignments" table, "Student ID" and "Class ID" together may serve as a composite key.
• Foreign Key
• A foreign key is a field (or combination of fields) in one table that establishes
a link to the primary key in another table. It is used to enforce relationships
between tables. Example: In an "Enrollments" table, the "Student ID" field
might be a foreign key that links to the "Students" table.
Referential Integrity.

• Referential Integrity
• Referential integrity is a rule in relational databases that ensures that a
foreign key in one table always refers to a valid record in another table. It
prevents "orphaned" records where a foreign key refers to a nonexistent
primary key.
Types of Relationships in Database.
• One-to-One
• A relationship where one record in a table is associated with exactly one
record in another table.
• Use Case:
• Used when each entity in a table has exactly one corresponding entity in another table.
• Example:
• A person and their passport.
• A user and their profile in a system.
• One-to-Many
• A relationship where one record in a table can be associated with multiple records in
another table.
• Use Case:
• Commonly used to model hierarchical or parent-child relationships.
• Example:
• A teacher and the students they teach.
• A customer and their orders.
• Many-to-Many
• A relationship where multiple records in one table can be associated with multiple
records in another table.
• Use Case:
• Used when both entities can have multiple associations with each other.
• Example:
• Students and the courses they are enrolled in.
• Authors and the books they write.
Introduction to Data Modelling & its
importance

• Introduction to Data Modelling.


• Data modelling is the process of creating a visual representation of a system
or data structure. It defines how data is organized, stored, and accessed. The
primary goal is to simplify complex datasets and ensure accurate
representation of data relationships, processes, and rules within a system.
Importance of Data Modelling

• Clear Data Structure:


• Provides a structured approach to organizing data.

• Helps define relationships, hierarchies, and data dependencies.

• Improved Communication:
• Bridges the gap between technical teams and stakeholders.

• Enables stakeholders to visualize and validate data requirements.


• Data Integrity and Quality:
• Ensures consistency and accuracy in data storage and retrieval.

• Prevents duplication and reduces redundancy.

• Efficient System Design:


• Optimizes database design for performance and scalability.

• Helps avoid costly redesigns or inefficiencies post-deployment.


Entity Relationship Diagram (ERD)

• An Entity Relationship Diagram (ERD) is a type of visual representation that illustrates


the structure of a database, showing how data is organized and how various elements
are interconnected. It uses symbols to represent:

• Entities: These are the main objects or components in the system, often corresponding
to tables in a database. For example, "Student" or "Course.“

• Attributes: These are the properties or details of an entity. For instance, a "Student"
entity might have attributes like “Name”, “ID” and “Date of Birth”.
• Relationships:
• These describe how entities are linked to each other. For example, a
"Student" may "Enroll" in a "Course."
Entity Relationship Diagram (ERD)
Key Elements of an ERD

• Rectangles: Represent entities.

• Ovals: Represent attributes.

• Diamonds: Represent relationships between entities.

• Lines: Connect entities, attributes, and relationships.

• Cardinality: Indicates the number of occurrences in a relationship


(e.g., one-to-one, one-to-many, many-to-many).

You might also like