You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL (Structured Query Language) is used to interact with relational databases.
To find all users who are over 25 years old:
SELECT name, age
FROM users
WHERE age >25;
Result (SQL):
name
age
John Doe
28
What is NoSQL (Non-relational Database)?
Popular NoSQL databases
MongoDB, Redis
Structure
NoSQL databases are more flexible and can store data in a variety of formats like documents (e.g., MongoDB) or key-value pairs (e.g., Redis).
Document Structure (NoSQL): In MongoDB, data is stored in documents, which are similar to JSON objects. The collection name is users, and each document looks like this:
Why Database?
Common website architecture:
Frontend (user interface) - Backend (API, database...)
UI (HTML, CSS, JavaScript) - API (Java) - Database (MongoDB)
Similar examples from the real world: Restaurant - Waiter - Kitchen
What is SQL (Relational Database)?
Popular SQL Databases
PostgreSQL, MySQL
Structure
SQL databases are organized into tables with predefined schemas.
Query Language
SQL (Structured Query Language) is used to interact with relational databases.
To find all users who are over 25 years old:
Result (SQL):
What is NoSQL (Non-relational Database)?
Popular NoSQL databases
MongoDB, Redis
Structure
NoSQL databases are more flexible and can store data in a variety of formats like documents (e.g., MongoDB) or key-value pairs (e.g., Redis).
Document Structure (NoSQL): In MongoDB, data is stored in documents, which are similar to JSON objects. The collection name is users, and each document looks like this:
Querying Data (MongoDB)
To find all users who are over 25 years old:
Result (MongoDB):
Key Differences
The text was updated successfully, but these errors were encountered: