SQL — relational, structured. NoSQL — non-relational, flexible.
SQL (Relational):
SQL:
Tables with fixed schema
SELECT * FROM users WHERE age > 25
JOIN orders ON users.id = orders.user_id
(Complex queries, ACID)
NoSQL:
NoSQL Types:
- Document: MongoDB
- Key-Value: Redis
- Column-Family: Cassandra
- Graph: Neo4j
(Flexible, scalable)
Key differences: