Which statement best describes SQL vs NoSQL databases?
Options
- NoSQL means a kind of database that holds no data at all
- SQL uses tables with a fixed schema and joins; NoSQL uses flexible models (Correct option)
- SQL is always faster than NoSQL, whatever the workload is
- NoSQL databases cannot store JSON documents or nested data
Answer
SQL databases store data in tables with a fixed schema and support joins; NoSQL covers other models (documents, key-value, wide-column, graph) with more flexible schemas
Why
SQL (relational) databases such as PostgreSQL and MySQL use tables with defined columns, relationships through keys, joins and strong transactions.
NoSQL is a family of other models: document stores (MongoDB), key-value (Redis, DynamoDB), wide-column (Cassandra), graph (Neo4j). They often trade some features for flexibility or horizontal scale.
For most business apps, a relational database is the safe default.
Remember
Relational = tables + joins + transactions. NoSQL = other data models.