Font size
WorksheetsMongoDB Quiz
Total questions: 25
Worksheet time: 20mins
A ___?___ is a grouping of MongoDB documents and is the equivalent of a table in relational databases.
(a)
The documents in a multiple collection in MongoDb need to have the same set of fields and the data type for a field can differ across documents within a collection.
True
False
What is the primary method used for connecting tables in a Nosql database?
embedding
referencing
N/A
Which MongoDB query operator allows you to update specific elements in an embedded array?
$push
$addToSet
$elemMatch
$set
In a school project, how can you represent a one-to-many relationship using embedding?
Storing foreign keys
Storing an array of sub-documents
Using $lookup aggregation
Creating separate collections
Why did Ethan choose to reference instead of embedding in MongoDB?
To simplify data retrieval
To optimize query performance
To handle one-to-many relationships
To avoid data duplication and inconsistency
What is the main benefit of using embedding in MongoDB?
Reduced data duplication
Easier to update related data
Improved query performance for complex joins
All of the above
When should you consider using referencing instead of embedding in MongoDB?
For one-to-one relationships
When query performance is critical
When data consistency is a top priority
For denormalized data structures
How does embedding in a school database affect the storage size of student records?
Increases the size significantly
Decreases the size significantly
Has no impact on the size
Depends on the number of courses taken by each student
In a school project, Evelyn is tasked with capturing relationships between different subjects by storing related information in a single document structure. What method should Evelyn use for this purpose?
(a)
In a school setting, how can we store the relationships between students and their grades by including links or references from one record to another
(a)
Embedded data models make it possible to update related data in a single atomic write operation.
True
False
How does using separate collections in MongoDB impact the scalability of a school database?
Improves data retrieval speed
Reduces data redundancy
Enhances data consistency
May lead to performance issues
In MongoDB, it is always recommended to embed one-to-many relationships within a single document.
True
False
In MongoDB, denormalization is a common practice to optimize read performance at the cost of increased storage.
True
False
MongoDB supports ACID transactions for multi-document operations across multiple collections.
True
False
Using smaller documents containing more frequently-accessed data enlarges the overall size of the working set
True
False
With MongoDB, you may embed related data in a single structure or document. These schema are generally known as “normalized”
True
False
Documents in MongoDB must be smaller than the maximum BSON document size, which is 16 kilobytes
True
False
When using references, the growth of the relationships determine where to store the reference.
True
False
The ___?___ field in MongoDB is a 12-byte unique identifier for documents within a collection.
(a)
Embedding one-to-many relationships directly within a document is called ___?___.
(a)
In MongoDB, the $push operator is used to ___?___ new items to an array field in a document.
(a)
Normalized data models describe relationships using ___?___ between documents.
(a)
What is the main benefit of denormalized data structures in a MongoDB database?
Improved data consistency
Reduced storage size
Enhanced query performance
Facilitates complex join operations
