Database by Muhammad Owais
Database by Muhammad Owais
Muhammad Owais
IT 2ND SEMESTER
DATABASE BY MUHAMMAD OWAIS
What is a Database?
A database is a collection of organized data stored in a way that allows for efficient retrieval and
manipulation.
File-based System
Think of a file-based system in DBMS as a basic way to organize information using files and folders on your
computer. Imagine you have a physical filing cabinet for your documents:
• Files: These are like papers inside the cabinet. Each paper holds specific information.
• Folders: These help organize your papers into different categories, like "Invoices," "Reports," and "Letters."
In a file-based system:
• Storage: Data is stored in separate files.
• Manual Management: You have to manually create, organize, and manage these files.
• Redundancy: Sometimes, you might accidentally duplicate data, like having the same invoice in two folders.
• Inconsistency: Since there's no central control, the same information might be updated differently in two
files.
1
DATABASE BY MUHAMMAD OWAIS
There is another program which prints the student’s report and mails it to the address mentioned
in the Student_ReportCard file.
What happens to the report of a student whose address is being changed? There is a mismatch in the
actual address and his report is sent to his old address. This mismatch in different copies of same data
is called data inconsistency (loss of data integrity).
DATA DEPENDENCE
The data stored in file depends upon the application program through which the file was created. It means
that the structure of data files is coupled with application program.
DATABASE
A database is an organized collection of structured information, or data, typically stored electronically in a computer
system. A database is usually controlled by a database management system (DBMS).
What is DBMS?
Database Management Systems (DBMS) are software systems used to store, retrieve, and run queries
on data. A DBMS serves as an interface between an end-user and a database, allowing users to create,
read, update, and delete data in the database.
Data abstractions
in DBMS refer to hiding unnecessary data from the end-user. Example: If we want to retrieve any email
from Gmail, we don't know where that data is physically kept, such as in India or the United States, or
what data model was utilized to store it. These things are not essential to us
Attribute
In a database management system (DBMS), an attribute is a piece of data that describes an entity. For
example, in a customer database, the attributes might be name, address, and phone number. In a
product database, the attributes might be name, price, and date of manufactur.
ENTRY
In a database management system (DBMS), an entity is a piece of data that is stored in the database.
An entity can be a person, place, thing, or even an event. \
2
DATABASE BY MUHAMMAD OWAIS
DDL (Data Definition Language) provides the ability to define, create and modify database objects such
as tables, views, indexes, and users.
DML (Data Manipulation Language) allows for manipulating data in a database, such as inserting,
updating, and deleting records.
Database architecture refers to the design and structure of a database system, defining how data is
stored, managed, and utilized. There are typically three levels of database architecture
3
DATABASE BY MUHAMMAD OWAIS
business rules). These constraints describe the main characteristics of the data as viewed by the
organization
The physical database designer decides how the logical database design is to be physically realized. This
involves:
• mapping the logical database design into a set of tables and integrity constraints;
• selecting specific storage structures and access methods for the data to achieve good
performance;
• designing any security measures required on the data
Sure thing! Let's break it down even further.
Data independence
4
DATABASE BY MUHAMMAD OWAIS
Data independence refers to the ability to modify the schema at one level of a database system without having to
alter the schema at the next higher level. This concept is crucial in database management systems (DBMS) as it helps
in simplifying database management and enhances its flexibility.
There are two types of data independence:
Important Terminologies
• Attribute: Attributes are the properties that define an entity. e.g.; ROLL_NO, NAME, ADDRESS
• Relation Schema: A relation schema defines the structure of the relation and represents the name of the
relation with its attributes. e.g.; STUDENT (ROLL_NO, NAME, ADDRESS, PHONE, and AGE) is the
relation schema for STUDENT. If a schema has more than 1 relation, it is called Relational Schema.
• Tuple: Each row in the relation is known as a tuple. The above relation contains 4 tuples,
• Relation Instance: The set of tuples of a relation at a particular instance of time is called a relation instance.
Table 1 shows the relation instance of STUDENT at a particular time. It can change whenever there is an
insertion, deletion, or update in the database.
• Degree: The number of attributes in the relation is known as the degree of the relation.
The STUDENT relation defined above has degree 5.
• Cardinality: The number of tuples in a relation is known as cardinality. The STUDENT relation defined
above has cardinality 4.
5
DATABASE BY MUHAMMAD OWAIS
• Column: The column represents the set of values for a particular attribute. The column ROLL_NO is
extracted from the relation STUDENT.
• NULL Values: The value which is not known or unavailable is called a NULL value. It is represented by
blank space. e.g.; PHONE of STUDENT having ROLL_NO 4 is NULL.
• Relation Key: These are basically the keys that are used to identify the rows uniquely or also help in
identifying tables. These are of the following types.
• Primary Key
• Candidate Key
• Super Key
• Foreign Key
• Alternate Key
• Composite Key
Domain Constraints
These are attribute-level constraints. An attribute can only take values that lie inside the domain range. e.g.; If a
constraint AGE>0 is applied to STUDENT relation, inserting a negative value of AGE will result in failure.
Key Integrity
Every relation in the database should have at least one set of attributes that defines a tuple uniquely. Those set of
attributes is called keys. e.g.; ROLL_NO in STUDENT is key. No two students can have the same roll number. So
a key has two properties:
• It should be unique for all tuples.
• It can’t have NULL values.
Referential Integrity
When one attribute of a relation can only take values from another attribute of the same relation or any other
relation, it is called referential integrity.
We can’t insert a row in REFERENCING RELATION if referencing attribute’s value is not present in the
referenced attribute value. e.g.; Insertion of a student with BRANCH_CODE ‘ME’ in STUDENT relation will
result in an error because ‘ME’ is not present in BRANCH_CODE of BRANCH.
We can’t delete or update a row from REFERENCED RELATION if the value of REFERENCED ATTRIBUTE is
used in the value of REFERENCING ATTRIBUTE. e.g; if we try to delete a tuple from BRANCH having
BRANCH_CODE ‘CS’, it will result in an error because ‘CS’ is referenced by BRANCH_CODE of STUDENT,
but if we try to delete the row from BRANCH with BRANCH_CODE CV, it will be deleted as the value is not been
used by referencing relation. It can be handled by the following method:
6
DATABASE BY MUHAMMAD OWAIS
On Delete Cascade
It will delete the tuples from REFERENCING RELATION if the value used by REFERENCING ATTRIBUTE is
deleted from REFERENCED RELATION. e.g.; For, if we delete a row from BRANCH with BRANCH_CODE
‘CS’, the rows in STUDENT relation with BRANCH_CODE CS (ROLL_NO 1 and 2 in this case) will be deleted.
On Update Cascade
It will update the REFERENCING ATTRIBUTE in REFERENCING RELATION if the attribute value used by
REFERENCING ATTRIBUTE is updated in REFERENCED RELATION. e.g;, if we update a row from BRANCH
with BRANCH_CODE ‘CS’ to ‘CSE’, the rows in STUDENT relation with BRANCH_CODE CS (ROLL_NO 1
and 2 in this case) will be updated with BRANCH_CODE ‘CSE’.
Super Keys
Any set of attributes that allows us to identify unique rows (tuples) in a given relationship is known as super keys.
Out of these super keys, we can always choose a proper subset among these that can be used as a primary key. Such
keys are known as Candidate keys. If there is a combination of two or more attributes that are being used as the
primary key then we call it a Composite key.
7
DATABASE BY MUHAMMAD OWAIS
As discussed earlier, a relational database is based on the relational model. This database consists of various
components based on the relational model. These include:
• Relation: Two-dimensional table used to store a collection of data elements.
• Tuple: Row of the relation, depicting a real-world entity.
• Attribute/Field: Column of the relation, depicting properties that define the relation.
• Attribute Domain: Set of pre-defined atomic values that an attribute can take i.e., it describes the
legal values that an attribute can take.
• Degree: It is the total number of attributes present in the relation.
• Cardinality: It specifies the number of entities involved in the relation i.e., it is the total number
of rows present in the relation.
• Relational Schema: It is the logical blueprint of the relation i.e., it describes the design and
the structure of the relation. It contains the table name, its attributes, and their types:
For our Student relation example, the relational schema will be:
• Relational Instance: It is the collection of records present in the relation at a given time
Fundamental Operators
• Selection(σ)
• Projection(π)
• Union(U)
• Set Difference(-)
• Set Intersection(∩)
• Rename(ρ)
• Cartesian Product(X)
What is Projection?
• This operation selects certain required attributes, while discarding other attributes. Projection in DBMS is a
process of selecting some specific attribute/columns from a table while excluding the other attributes/columns
from a selected table. It is useful for selecting a set of required attributes of the data.
• Notation –
• πA (R)
• Projection Query
• The following query retrieves only the Name and Salary columns from the Employees table:
8
DATABASE BY MUHAMMAD OWAIS
• Relation Algebra: πName Salary (Employees)
• SQL Query : SELECT Name, Salary FROM Employees;
Select operation
chooses the subset of tuples from the relation that satisfies the given condition mentioned in the syntax of selection.
The selection operation is also known as horizontal partitioning since it partitions the table or relation horizontally.
Notation:
σ c(R)
where ‘c’ is the selection condition which is a boolean expression(condition), we can have a single condition like
Roll= 3 or a combination of conditions like X>2 AND Y<1, and symbol ‘σ (sigma)’ is used to denote select(choose)
operator,
R is a relational algebra expression, whose result is a relation. The boolean expression specified in condition ‘c’ can be
written in the following form:
where <attribute name> is the name of an attribute of relation, <comparison operator> is any of the operator {<, >, =,
<=, >=, !=} and, <constant value> is a constant value taken from the domain of the relation.
Example-1:
The query above(immediate) is called nested expression, here, as usual, we evaluate the inner expression first (which
results in relation say Manager1), then we calculate the outer expression on Manager1(the relation we obtained from
evaluating the inner expression), which results in relation again, which is an instance of a relation we input.
Example-2:
Given a relation Student(Roll, Name, Department, Fees, Team) with the following tuples:
On applying CARTESIAN PRODUCT on two relations that is on two sets of tuples, it will take every tuple one by
one from the left set(relation) and will pair it up with all the tuples in the right set(relation).
9
DATABASE BY MUHAMMAD OWAIS
So, the CROSS PRODUCT of two relation A(R1, R2, R3, …, Rp) with degree p, and B(S1, S2, S3, …, Sn) with
degree n, is a relation C(R1, R2, R3, …, Rp, S1, S2, S3, …, Sn) with degree p + n attributes.
CROSS PRODUCT is a binary set operation means, at a time we can apply the operation on two relations. But the two
relations on which we are performing the operations do not have the same type of tuples, which means Union
compatibility (or Type compatibility) of the two relations is not necessary.
Notation:
A✕S
To combine data from these two tables, we can join them on the customer ID column, which is common to both tables.
By doing so, we can retrieve information about each customer’s orders in a single query.
TYPES OF JOINTS
INNER JOIN
SELECT columns
FROM table1
INNER JOIN table2
ON table1.column = table2.column;
• Description: Returns all records from the left table, and the matched records from the right table. The result is
NULL from the right side if there is no match.
SELECT columns
FROM table1
LEFT JOIN table2
ON table1.column = table2.column;
RIGHT JOIN (RIGHT OUTER JOIN)
• Description: Returns all records from the right table, and the matched records from the left table. The result is
NULL from the left side if there is no match.
SELECT columns
FROM table1
RIGHT JOIN table2
ON table1.column = table2.column;
FULL JOIN (FULL OUTER JOIN)
10
DATABASE BY MUHAMMAD OWAIS
• Description: Returns all records when there is a match in either left or right table. If there is no match, the
result is NULL from the left or right side.
SELECT columns
FROM table1
FULL JOIN table2
ON table1.column = table2.column;
CROSS JOIN
• Description: Returns the Cartesian product of both tables. This means it returns all records from the left table,
and each record is paired with all records from the right table.
SELECT columns
FROM table1
CROSS JOIN table2;
SELF JOIN
• Description: A regular join, but the table is joined with itself.
SELECT A.columns, B.columns
FROM table AS A, table AS B
WHERE condition;
A Key can be a single attribute or a group of attributes, where the combination may act as a key.
Super Key
Super Key is defined as a set of attributes within a table that can uniquely identify each record within a table. Super
Key is a superset of Candidate key.
In the table defined above super key would include student_id, (student_id, name), phone etc.
Confused? The first one is pretty simple as student_id is unique for every row of data, hence it can be used to identity
each row uniquely.
Next comes, (student_id, name), now name of two students can be same, but their student_id can't be same hence this
combination can also be a key.
Similarly, phone number for every student will be unique, hence again, phone can also be a key.
Candidate Key
Candidate keys are defined as the minimal set of fields which can uniquely identify each record in a table. It is an
attribute or a set of attributes that can act as a Primary Key for a table to uniquely identify each record in that table.
There can be more than one candidate key.
In our example, student_id and phone both are candidate keys for table Student.
• A candiate key can never be NULL or empty. And its value should be unique.
11
DATABASE BY MUHAMMAD OWAIS
Primary Key
Primary key is a candidate key that is most appropriate to become the main key for any table. It is a key that can
uniquely identify each record in a table.
For the table Student we can make the student_id column as the primary key.
Composite Key
Key that consists of two or more attributes that uniquely identify any record in a table is called Composite key. But
the attributes which together form the Composite key are not a key independentely or individually.
Non-key Attributes
Non-key attributes are the attributes or fields of a table, other than candidate key attributes/fields in a table.
Non-prime Attributes
Non-prime Attributes are attributes other than Primary Key attribute(s)..
What is Normalization?
o Normalization is the process of organizing the data in the database.
o Normalization is used to minimize the redundancy from a relation or set of relations. It is also used to
eliminate undesirable characteristics like Insertion, Update, and Deletion Anomalies.
o Normalization divides the larger table into smaller and links them using relationships.
o The normal form is used to reduce redundancy from the database table.
Types Of Normalization?
The types of normalization in a database management system (DBMS) are:
• First normal form (1NF)
The foundation of normalization, 1NF requires that a table's attribute can only hold a single value. This is done by
removing duplicate data and minimizing attributes and relations.
12
DATABASE BY MUHAMMAD OWAIS
All types of database normalization are cumulative, meaning each one builds on top of the previous one.
Functional dependencies can also be represented using mathematical notation. For example, the functional
dependency above can be represented as:
Employee ID → Employee Name, Address, etc.
It’s important to note that functional dependencies only apply to the individual tuples in the table, and not to
the table as a whole.
13
DATABASE BY MUHAMMAD OWAIS
• Purpose
The ER model is a blueprint for a database that helps developers and stakeholders understand the data organization.
• Visual representation
The ER model is visually represented as an Entity Relationship Diagram (ER Diagram) that uses boxes, symbols, and
connectors.
• Components
The ER model is based on three main components: entities, attributes, and relationships.
• Cardinality
Database management system (DBMS), cardinality refers to the relationship between data in one table and another
table. The relationship is specified by how many times an entity occurs in the relationship. Cardinality can be used to
define data models and analyze entities within datasets.
Types Of Cardinality
The three types of cardinality relationships are:
• One-to-one
One row in one table relates to one row in another table. For example, a school might use a one-to-one relationship to
assign a single student ID to each student.
• One-to-many
One row in one table relates to many rows in another table. For example, a doctor might have many patients.
• Many-to-many
Many rows in one table relate to many rows in another table. For example, a student might sign up for many classes,
and a class might have several students in it.
Cardinality can also be divided into high and low cardinality. A column or row has high cardinality if it consists of
many distinct values, and low cardinality if it consists of many repeated values
14
DATABASE BY MUHAMMAD OWAIS
• Example
An ER diagram could show the relationship between a student and a course, which might be many-to-many. A student
might be able to take more than one course, and a course might be taken by more than one student.
1. Entity:
An entity may be any object, class, person or place. In the ER diagram, an entity can be represented as rectangles.
Consider an organization as an example- manager, product, employee, department etc. can be taken as an entity.
a. Weak Entity
An entity that depends on another entity called a weak entity. The weak entity doesn't contain any key attribute of its
own. The weak entity is represented by a double rectangle.
2. Attribute
The attribute is used to describe the property of an entity. Eclipse is used to represent an attribute.
For example, id, age, contact number, name, etc. can be attributes of a student.
a. Key Attribute
The key attribute is used to represent the main characteristics of an entity. It represents a primary key. The key
attribute is represented by an ellipse with the text underlined.
15
DATABASE BY MUHAMMAD OWAIS
b. Composite Attribute
An attribute that composed of many other attributes is known as a composite attribute. The composite attribute is
represented by an ellipse, and those ellipses are connected with an ellipse.
c. Multivalued Attribute
An attribute can have more than one value. These attributes are known as a multivalued attribute. The double oval is
used to represent multivalued attribute.
For example, a student can have more than one phone number.
d. Derived Attribute
An attribute that can be derived from other attribute is known as a derived attribute. It can be represented by a dashed
ellipse.
For example, A person's age changes over time and can be derived from another attribute like Date of birth.
3. Relationship
A relationship is used to describe the relation between entities. Diamond or rhombus is used to represent the
relationship.
SQL
o SQL stands for Structured Query Language. It is used for storing and managing data in relational database
management system (RDMS). In RDBMS data stored in the form of the tables.
o It is a standard language for Relational Database System. It enables a user to create, read, update and delete
relational databases and tables.
o All the RDBMS like MySQL, Informix, Oracle, MS Access and SQL Server use SQL as their standard
database language.
o SQL allows users to query the database in a number of ways, using English-like statements.
o SQL is mostly used by engineers in software development for data storage. Nowadays, it is also used by data
analyst for following reason:
16
DATABASE BY MUHAMMAD OWAIS
QUERIES IN SQL
Creating a Table
Inserting Data
INSERT
INSERT INTO
INTO Students
Students (ID,(ID, FirstName,
FirstName, LastName,
LastName, Age,Age, Grade)
Grade) VALUES
VALUES (1, (1, 'John'
'John', , 'Doe'
'Doe', 20,, 20,
'A');'A');
INSERT
INSERT INTOStudents
INTO Students (ID,FirstName,
(ID, FirstName, LastName,
LastName, Age,
Age, Grade)
Grade) VALUES
VALUES (2,(2, 'Jane'
'Jane', , 'Smith'
'Smith', , 22,
22, 'B');
'B');
Output: This command inserts two records into the Students table.
Selecting Data
17
DATABASE BY MUHAMMAD OWAIS
Concurrency Control
1. Transactions: A sequence of operations performed as a single logical unit of work.
2. Concurrency Control Mechanisms: Techniques to manage simultaneous operations without
conflicts.
18
DATABASE BY MUHAMMAD OWAIS
o Locking: Prevents access to data by multiple transactions simultaneously. Common types of
locks:
▪ Shared Lock: Allows multiple transactions to read a resource.
▪ Exclusive Lock: Allows only one transaction to modify a resource.
o Timestamp Ordering: Ensures transactions are executed in the order of their timestamps.
o Optimistic Concurrency Control: Transactions execute without restrictions, and validation
is done at the end.
o Multiversion Concurrency Control (MVCC): Maintains multiple versions of data for
reading and writing.
Consistency Control
1. Consistency: Ensures the database remains in a valid state before and after a transaction.
2. ACID Properties: A set of properties to ensure reliable processing of transactions:
o Atomicity: Ensures that all operations of a transaction are completed, or none of them are.
o Consistency: Ensures that a transaction brings the database from one valid state to another.
o Isolation: Ensures that intermediate transaction results are invisible to other transactions.
o Durability: Ensures that once a transaction is committed, it remains so.
Database backup
Database backup is crucial for protecting data from loss, corruption, and other disasters. Here are some key
concepts and methods for database backup:
Types of Backups
1. Full Backup: Captures the entire database, including all data and objects. It’s the most comprehensive
but also the most time-consuming and storage-intensive.
BACKUP DATABASE [YourDatabase] TO DISK = 'C:\Backups\YourDatabase_Full.bak'
2. Differential Backup: Captures only the changes made since the last full backup. It’s faster and smaller
than full backups but depends on the last full backup.
sql
BACKUP DATABASE [YourDatabase] TO DISK = 'C:\Backups\YourDatabase_Differential.bak' WITH
DIFFERENTIAL
3. Incremental Backup: Captures only the changes made since the last backup of any type (full or
incremental). It’s the fastest and smallest but can be complex to restore.
sql
BACKUP LOG [YourDatabase] TO DISK = 'C:\Backups\YourDatabase_Incremental.bak'
Backup Strategies
1. Full Backup Strategy: Suitable for small databases where full backups can be taken regularly without
impacting performance.
2. Full + Differential Backup Strategy: A full backup is taken periodically (e.g., weekly), and
differential backups are taken more frequently (e.g., daily).
3. Full + Incremental Backup Strategy: A full backup is taken periodically (e.g., weekly), and
incremental backups are taken frequently (e.g., hourly or daily).
Best Practices
1. Automate Backups: Use scripts and tools to schedule regular backups.
2. Store Backups Securely: Store backups in a secure location, preferably offsite, to protect against
physical disasters.
3. Test Restore Procedures: Regularly test restoring backups to ensure that they can be successfully
recovered in case of an emergency.
19
DATABASE BY MUHAMMAD OWAIS
4. Use Encryption: Encrypt backups to protect sensitive data from unauthorized access.
Indexes in databases
Indexes in databases are special data structures that improve the speed of data retrieval operations. Here's a
detailed overview:
What Are Indexes?
Indexes are used to quickly locate and access the data in a database table. They work similarly to an index in
a book, allowing you to find information without scanning every page.
Types of Indexes
1. Primary Index: Created on the primary key of a table. Ensures that the key values are unique and
sorted.
sql
CREATE INDEX idx_primary ON Students (ID);
2. Secondary Index: Created on non-primary key columns to improve the performance of queries
involving these columns.
sql
CREATE INDEX idx_lastname ON Students (LastName);
3. Unique Index: Ensures that all the values in the indexed column are unique.
sql
CREATE UNIQUE INDEX idx_unique_email ON Students (Email);
4. Composite Index: Created on multiple columns of a table. Useful for queries involving multiple
columns in the WHERE clause.
sql
CREATE INDEX idx_composite ON Students (LastName, FirstName);
5. Full-Text Index: Used for full-text searches in large text fields.
sql
CREATE FULLTEXT INDEX idx_fulltext ON Students (Essay);
Benefits of Using Indexes
• Speed: Significantly improves the performance of read operations (SELECT queries).
• Efficiency: Reduces the amount of data scanned to find the desired rows.
• Sorting: Helps with sorting data (ORDER BY clause) without additional sorting steps.
Trade-offs and Considerations
• Storage: Indexes require additional storage space.
• Write Performance: Can slow down write operations (INSERT, UPDATE, DELETE) because the
indexes need to be updated as well.
• Maintenance: Requires periodic maintenance and optimization to ensure they remain efficient.
Examples of Using Indexes
sql
-- Creating an index on the LastName column
CREATE INDEX idx_lastname ON Students (LastName);
-- Dropping an index
DROP INDEX idx_lastname ON Students;
20
DATABASE BY MUHAMMAD OWAIS
Indexes are a crucial part of database design and optimization. They need to be carefully planned and
maintained to balance the benefits of faster query performance against the costs of additional storage and
maintenance.
What is NoSQL?
NoSQL systems are a type of database designed to handle a wide variety of data models, especially useful
for large-scale data storage and for big data applications. Here’s an overview:
NoSQL stands for "Not Only SQL." It represents a broad category of databases that are designed to handle
data more flexibly than traditional relational databases (SQL databases). These databases are schema-less,
meaning they don't require a fixed table structure.
Types of NoSQL Databases
1. Document Stores: Store data as documents, usually in JSON or BSON format. Great for hierarchical
data.
o Example: MongoDB
o Usage: Content management systems, e-commerce.
2. Key-Value Stores: Simple databases where each item is a key-value pair. Optimized for fast
lookups.
o Example: Redis
o Usage: Caching, session management.
3. Column Family Stores: Store data in columns rather than rows, allowing for very high scalability.
o Example: Apache Cassandra
o Usage: Real-time analytics, event logging.
4. Graph Databases: Focus on the relationships between data points, using nodes, edges, and
properties.
o Example: Neo4j
o Usage: Social networks, recommendation engines.
Advantages of NoSQL
• Scalability: Designed to scale out horizontally, handling large volumes of data and high traffic.
• Flexibility: Schema-less design allows for rapid changes and adaptability to different data types.
• Performance: Optimized for read and write operations, often outperforming traditional SQL
databases for certain workloads.
• Big Data: Particularly suited for handling big data applications due to their scalability and
performance.
When to Use NoSQL
• When your application needs to handle large volumes of unstructured or semi-structured data.
• When you require high performance and scalability.
• When the data model is dynamic or evolving.
• When you need to store and query hierarchical or graph-based data efficiently.
Example of NoSQL (MongoDB)
json
// Document example in MongoDB
{
"_id": "12345",
"FirstName": "John",
"LastName": "Doe",
21
DATABASE BY MUHAMMAD OWAIS
"Age": 30,
"Skills": ["JavaScript", "Node.js", "MongoDB"]
}
This JSON document could be part of a larger collection representing multiple users.
Conclusion
NoSQL databases provide a powerful, flexible way to handle modern data needs. They complement
traditional SQL databases and offer solutions to specific challenges in data storage and management.
THANK YOU
22