Unit 4
Introduction to
Databases
Definition and overview
Lecturer- Salma Zalkha
• Definition
• Examples of Databases
• Database Management System
(DBMS)
• Examples of Database Management
Overvie System (DBMS)
• Deference between Databases and
w DBMS
• Types of Databases
• Non-relational Databases (No-SQL)
• Relational Databases
• Students Task of the week
Based on what we see in the diagram, we can
conclude that
• A table stores some set of information (here, worker salaries).
• Every row in a table stores one item in that set (here, one worker).
• Every column has some attribute of that item (here, the salary for a
particular month).
In today’s information age, we can store our tables using software like
Google Sheets or Microsoft Excel instead
of paper
or stone tablets
Three reasons to move beyond spreadsheets
to databases are
• Scale: Databases can store not just items numbering to tens of
thousands but even millions and billions.
• Update Capacity: Databases are able to handle multiple updates of
data in a second.
• Speed: Databases allow faster look-up of information. This is because
databases provide us with access to different algorithms to retrieve
information. In contrast, spreadsheets that merely allow the use of
Ctrl+F or Cmd+F to go through hits one at a time.
Definition
A database is a way of organizing data such that you can perform four
operations on it
Create
Read
Update
Delete
Examples of database
Phone Directory
• A phone directory stores the phone numbers of different peoples. Any
phone number from the phone directory can be searched easily
because all phone numbers are stored in an organized way.
Library:
• A library contain thousands of books. A database system can be used
to store the records of books. The database can be used to search the
required books easily.
Types of Databases
Types of Databases
1- Relational Databases (SQL)
Organize data into tables
where each table has rows
and columns, and these
tables contain related
information .
Users Table
Name Password Email
John Smith ********* john@something.com
Alan Runner ********* alan@something.com
Structured Query language
Posts Table
Title Date Author
Relational Databases
My first post 15/01/2024 John Smith
Types of Databases
2- Non-Relational Databases
(NoSQL):
Do not strictly follow a table-based
structure with rows and columns.
Instead, they utilize a variety of
data models like document, key-
value, graph, and wide-column
stores to store and manage data.
User: {
"username": "john_doe",
"bio": "Loves coding",
"tweets": [
{"id": 1, "content": "Hello,
world!"},
{"id": 2, "content": "Another
day, another code."}
]
}
Database Management System (DBMS)
• Is a way to interact with a database using a graphical interface or
textual language.
• The DBMS software allows for the creation, querying, update, and
administration of databases.
• MySQL: For example, E-commerce, and online retail, Online Forums
• PostgreSQL: Geospatial Applications (like Google Maps or Waze)
• Oracle Database: Database in Financial Services (Banks)
• Microsoft SQL Server: A hospital management system
• SQLite: Data Storage for Offline Apps (eBooks readers), Mobile Games
Database VS Database Management
System
• Database is like a collection of books in a library, while the
• DBMS is like the librarian that manages and organizes the books,
helps you find specific books, ensures that the books are in good
condition, and that library rules are followed
Key Characteristics of NoSQL Databases
Schema-less
Scalability
Performance
Variety of Data Models:
Document: Store data in documents similar to
JSON or XML
Key-value: Data is stored in pairs of keys and
values
Wide-column: Store data in tables, rows, and
dynamic columns
Graph: They use graph structures with nodes,
edges, and properties to represent and store data.
NoSQL Databases
Advantages Disadvantages
Flexibility: Ability to store different types of Lack of Standardization: Different NoSQL
data structures. databases have different query languages and
models.
Scalability: Better suited for cloud
Consistency Models: Some NoSQL databases
computing and large-scale applications.
follow eventual consistency rather than the strict
Speed: Often provide faster read and write ACID (Atomicity, Consistency, Isolation,
Durability) properties of relational databases.
capabilities compared to traditional
relational databases. Complexity in Data Aggregation: Complex data
operations might be more challenging to
implement compared to SQL-based relational
databases.
Key Characteristics of Relational
databases
• Table-Based Structure
• Rows and Columns
• Data Integrity
• Relationships Between Tables
• Data Manipulation and Querying
• ACID Properties
• Scalability
• Normalization
Relational databases
Advantages Disadvantages
Data Accuracy and Integrity: Ensures reliable and Complexity: Can be complex to design and
consistent data through constraints and relational maintain, especially as data volume grows.
rules.
Performance Issues: Performance can degrade
Efficient Data Retrieval: Supports complex with very large databases or highly complex
queries and reporting tools for data analysis. queries.
User-Friendly: SQL is relatively easy to learn and Cost: Some RDBMS, like Oracle, can be costly in
use. terms of licensing and maintenance.
Security: Provides robust data protection Schema Rigidity: Changes in database schema
mechanisms and access controls. can be challenging to implement once the
database is in operation.
Case Studies on
Real-World
Task Database
Applications
Objective: To explore how different types of
databases are used in real-world applications
1. Select Case Studies:
Each student should select a real-world application or business that relies heavily on
database technology (e.g., a social media platform, an e-commerce website, a
healthcare system).
2. Research Database Use: You should research and report on:
1. The type of database used (RDBMS, NoSQL, etc.).
2. How the database supports the business or application's functions.
3. Any unique challenges that the database helps to address.
3. Learning Outcomes: Students should reflect on what they learned about the
practical uses and importance of databases in different sectors.
4. Deliverables:
A detailed presentation, I will choose 2 to pitch their studies.