Database Flashcards

1
Q

What is normalization in databases?

A

Normalization is the process of organizing data to reduce redundancy and improve data integrity.

Normalization typically involves dividing a database into tables and defining relationships between them.

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

What is a primary key?

A

A primary key is a unique identifier for a record in a database table.

Primary keys ensure that each record can be uniquely retrieved.

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

What is indexing, and why is it used?

A

Indexing improves database query performance by creating a data structure (e.g., B-tree) for faster data retrieval.

Indexes can significantly speed up the retrieval of rows from a table.

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

What is a JOIN in SQL?

A

A JOIN combines rows from two or more tables based on a related column.

Joins are fundamental for querying related data across multiple tables.

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

What is the difference between INNER JOIN and LEFT JOIN?

A

INNER JOIN returns only matching rows; LEFT JOIN returns all rows from the left table and matching rows from the right table.

LEFT JOIN includes non-matching rows from the left table, filling in NULLs for missing matches.

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

What is MongoDB, and how is it different from SQL databases?

A

MongoDB is a NoSQL database that stores data in JSON-like documents. It is schema-less and scales horizontally.

Unlike traditional SQL databases, MongoDB allows for flexible data structures.

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