Recall & Review
beginner
What is a table in traditional relational databases?
A table is like a spreadsheet with rows and columns where each row is a record and each column is a field or attribute.
Click to reveal answer
beginner
What is a collection in MongoDB?
A collection is a group of documents, similar to a table, but documents can have different structures and fields.
Click to reveal answer
intermediate
How do tables and collections differ in data structure?
Tables have fixed columns for all rows, while collections store flexible documents that can have different fields and nested data.
Click to reveal answer
intermediate
Why might you choose a collection over a table?
Collections allow more flexibility with data types and structures, making it easier to store complex or changing data without strict schemas.
Click to reveal answer
advanced
Can collections enforce schemas like tables do?
Collections can enforce schemas using validation rules, but they are generally more flexible and less strict than tables in relational databases.
Click to reveal answer
Which of the following best describes a MongoDB collection?
✗ Incorrect
A MongoDB collection stores multiple documents that can have different fields and structures.
In relational databases, what is a table primarily used for?
✗ Incorrect
Tables store data in rows and columns with a fixed schema for each column.
Which feature is a key difference between tables and collections?
✗ Incorrect
Collections allow documents with different fields and nested data, unlike tables which have fixed columns.
Why might MongoDB collections be preferred for rapidly changing data?
✗ Incorrect
Collections allow flexible document structures, making them ideal for data that changes often.
Can MongoDB collections enforce data validation?
✗ Incorrect
MongoDB collections can enforce validation rules to ensure data meets certain criteria.
Explain the main differences between tables in relational databases and collections in MongoDB.
Think about structure and flexibility.
You got /4 concepts.
Describe a situation where using a MongoDB collection is better than a relational table.
Consider data flexibility and schema requirements.
You got /4 concepts.