SQL vs NOSQL Flashcards

when to choose a database

1
Q

What is the primary structure of SQL databases?

A

Relational databases with tables, rows, and columns

SQL databases store data in a structured format, similar to a spreadsheet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does ACID stand for in the context of SQL databases?

A

Atomicity, Consistency, Isolation, Durability

These properties ensure strong data integrity in SQL databases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name three examples of SQL databases.

A
  • MySQL
  • PostgreSQL
  • Oracle

These are common relational database management systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do NoSQL databases differ from SQL databases in terms of schema?

A

NoSQL databases are schema-less or schema-flexible

This allows for easier changes to data structure without predefined schema.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the primary querying language used in SQL databases?

A

SQL (Structured Query Language)

SQL allows for complex queries, including joins and aggregations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does BASE stand for in NoSQL databases?

A

Basically Available, Soft state, Eventually consistent

This model prioritizes availability over strict consistency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a key advantage of NoSQL databases?

A

Highly scalable and flexible schema

NoSQL databases can handle large, distributed data sets more easily.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What type of scalability do SQL databases typically use?

A

Vertical scalability

This involves increasing the hardware capacity of the server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What type of scalability do NoSQL databases typically use?

A

Horizontal scalability

This allows adding more servers to handle larger loads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In what scenarios are SQL databases best suited?

A
  • Transactional applications
  • Applications requiring strong consistency
  • Well-defined data structures

Examples include banking, e-commerce, and CRM systems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

List two types of NoSQL databases.

A
  • Document-based (e.g., MongoDB)
  • Key-value (e.g., Redis)

These types illustrate the variety in NoSQL database structures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

True or False: NoSQL databases are typically better for complex relationships.

A

False

SQL databases are designed for complex relationships using foreign keys and joins.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Fill in the blank: SQL databases are __________, meaning they store data in a predefined schema.

A

relational

This structure is essential for maintaining complex relationships in data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a disadvantage of SQL databases?

A

Difficult to scale horizontally

SQL databases primarily rely on vertical scaling, which has limitations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a disadvantage of NoSQL databases?

A

Lack of consistency may lead to data integrity issues

The BASE model can compromise strict consistency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What type of applications are NoSQL databases suitable for?

A
  • Big data applications
  • Real-time analytics
  • Rapidly evolving applications

Examples include social media platforms and IoT systems.

17
Q

What is the performance characteristic of NoSQL databases?

A

Optimized for high throughput and low-latency access

This makes them suitable for scenarios with frequent reads and writes.

18
Q

What is a common use case for SQL databases?

A

Applications requiring strong consistency and complex transactions

Common in banking and financial services.

19
Q

True or False: SQL databases can easily adapt to changes in data structure.

A

False

Changes to schema in SQL databases can be complex and require migrations.

20
Q

What is an example of a document-based NoSQL database?

A

MongoDB

MongoDB stores data in flexible, JSON-like documents.

21
Q

How do SQL and NoSQL databases differ in handling data relationships?

A

SQL handles complex relationships with foreign keys and joins; NoSQL is less focused on relationships

NoSQL often stores denormalized data.

22
Q

What can be said about the querying capabilities of NoSQL databases?

A

Limited querying capabilities compared to SQL, especially for complex joins

While some NoSQL databases like MongoDB support limited joins, they are generally less powerful.