0% found this document useful (0 votes)
19 views34 pages

NoSQL Test

The text discusses how to implement many-to-many relationships in non-relational databases like MongoDB. These relationships are more difficult to implement than one-to-many relationships. However, MongoDB allows storing arrays in documents, making it easier to store and retrieve linked data between documents.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views34 pages

NoSQL Test

The text discusses how to implement many-to-many relationships in non-relational databases like MongoDB. These relationships are more difficult to implement than one-to-many relationships. However, MongoDB allows storing arrays in documents, making it easier to store and retrieve linked data between documents.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Question 1 Answered

They are designed to support multiple data models in a single


integrated back-end. Most of the database management systems
data is organized around a single data model that determines
how data can be organized, stored, and manipulated. On the other
side, the database in question allows a company to store parts
the data from the system in different data models, simplifying the
application development (DATASTAX, 2022; PATTINSON, 2020).

Select the option that indicates the type of non-relational database addressed.
in the text.

Key-value databases
Tabular databases

multi-model databases

Correction of the test


Fontsize Talk to the tutor
Document databases

Test Databases No
final Relational
Corrections 1 of 10

Note 5 points
Graph or graph databases

Correct Wrong

Your answer
1 2 3 4 5

Document databases
6 7 8 9 10

Correct alternative: Multi-model databases CORRECT are designed to


Front Next
to provide support for multiple data models in a single integrated back-end. The goal of the
The issue is to know that there are several data models in a single integrated back-end. The
the majority of database management systems are organized around a single
data model that determines how data can be organized, stored and
manipulated. On the other hand, the database in question allows a company
store parts of the system data in different data models, simplifying the
application development (DATASTAX, 2022; PATTINSON, 2020). Databases
of key values. INCORRECT, as they are some of the least NoSQL databases
complex, as all of their data consists of an indexed key and a value. They use
a hash mechanism so that, given a key, the database can retrieve
quickly an associated value. Databases
tabular. INCORRECT, because it organizes data in rows and columns, but with a twist
different. Also known as wide column stores or stores
of partitioned lines, they offer the option to organize related lines into partitions
that are stored together in the same replicas to allow for quick queries. Banks of
data from documents. INCORRECT, as they expand the basic idea of storage of
key values, where the "documents" are more complex, as they contain data and each
the document receives a unique key, which is used to retrieve the document. They are
designed to store, retrieve, and manage document-oriented information,
usually stored as JSON. Graph or graph databases.
INCORRECT, as they store their data using a graphical metaphor to explore the
relationships between the data. The nodes in the graph represent data items and the edges represent
the relationships between data items. Graph databases are designed to
highly complex and connected data that exceed the resources for relationship and join
of an RDBMS.
Question 2 Answered

Thinking of bringing improvements, MongoDB has brought an update, adhering


Correction of the exam
thus for its version 5.0. New features were introduced with it. Fontsize Talk to the tutor

the aim of continuously improving the user experience, and consequently


facilitate the use of the software. Test Databases No
final Relational
Corrections 1 of 10
Note 5 points
A "time series" refers to any type of data where the
records are created sequentially at different points in time. Cases of Correct Wrong
common uses include sensor measurement flows and historical records
of transactions, where each record corresponds directly to a 1 2 3 4 5

specific moment.
6 7 8 9 10

BECAUSE Previous Next

II. Time series data are difficult to manage and as a result,


a developer is left to deal with a very high volume of data.
In addition, this type of data is interrupted with minimal updates.
Therefore, data queries usually rely heavily on the use of filters.
based on time.

Regarding these assertions, mark the correct alternative.

Assertions I and II are true propositions, but II does not justify I.

Assertion I is a false proposition and II is true.

Assertion I is a true proposition and II is false.


Assertions I and II are true propositions and II justifies I.

Assertions I and II are false propositions.

Your answer

Assertions I and II are true propositions and II justifies I.

Correct alternative: Assertions I and II are true propositions, but II does not justify the
I. Considering the necessary improvements, MongoDB is undergoing constant updates, and we have
the version of series 5.0, which introduced new features aimed at improving even more
the user experience, and consequently facilitate the use of the software. Speaking of the new
The version of MongoDB and its improvements, we have to: I. A 'time series' refers to
any type of data where records are created sequentially in different
points in time. Common use cases include sensor measurement flows and records
of transaction history, where each record corresponds directly to a
specific moment, it is a correct statement. And statement II. The time series data
are difficult to manage and as a result, a developer is left to deal with a
very high volume of data. In addition, this type of data is interrupted with updates
minimums. Therefore, queries on the data often depend on the intensive use of filters
based on time, it is also a correct statement. However, the II is not a
justification of I, just a complement to the studies related to new improvements
brought by MongoDB. Thus, we have that assertions I and II are propositions
true, but II does not justify I.
Question 3 Answered

Since there is no single command to implement a relationship


many-to-many in a relational database is more difficult than a
one-to-many relationship. The same is true when using mongoDB to
implement them. The ability to store arrays in a document, on the other hand
side, allows for data to be stored in an easily retrievable and maintainable way, in addition to
provide the necessary information to link two documents in your
code.

Based on the definitions of many-to-many modeling, evaluate the following


assertions and the proposed relationship between them.

Many-to-many relationships are a type of relationship.


MongoDB in which any two entities in a document can have several
relationships.
Correction of the exam
Fontsize Talk to the tutor

Test Databases No
WHY final Relational
Corrections 1 of 10

Note 5 points

It is a kind of vice-versa relationship between the documents. In this type of


Correct Wrong
relationship, there can be relationships in both directions.
1 2 3 4 5

Regarding these assertions, mark the correct alternative.


6 7 8 9 10

Anterior Next

Assertions I and II are true propositions, but II does not justify I.

Assertions I and II are true propositions, and II justifies I.

Assertion I is a true proposition and II is false.


Assertion I is a false proposition and II is true.

Assertions I and II are false propositions.

Your response

Assertions I and II are true propositions and II justifies I.

Correct alternative: Assertions I and II are true propositions and II justifies I.


Based on the definitions of many-to-many modeling, we have that: The relationships
many to many is a type of relationship in MongoDB in which any two entities
In a document, there can be several relationships. It is a kind of vice-versa relationship.
among the documents. In this type of relationship, there can be relationships in both
senses, like terms that a movie can have many actors, on the other hand, many actors
They can make a movie. Furthermore, many movies can have many actors and many actors.
many movies can be made. Therefore, regarding these assertions, we have that statements I and
II are true propositions and II justifies I.
Question 4 Answered

Each document in the collection has a field "_id" that is used to identify
exclusively the document in a specific collection, it acts as the key
primary for the documents in the collection. The field “_id” can be used in
any format and the standard format is ObjectId of the document (GEEKS FOR
GEEKS, 2020).

In MongoDB, each document stored in a collection requires a field.


_exclusive ID that acts as a primary key. If an inserted document omits the
field _id, the MongoDB driver automatically generates an ObjectId for the field
MongoDB clients must add an _id field with an ObjectId
exclusive. The use of ObjectIds for the _id field offers the following benefits
additional:

Returns the hexadecimal string representation of the object.


Generate a new ObjectId using a hexadecimal string ObjectId()
exclusive

[Link]() returns the timestamp part


ObjectId() as a Date.

In mongoshell, you can access the creation time of the ObjectId using
the method [Link]();

The [Link]() returns the value of ObjectId() as a string


lowercase hexadecimal. This value is the str attribute of the ObjectId() object.

Your answer

Generate a new ObjectId using a unique hexadecimal string ObjectId()


Complete statement: In the mongoshell, you can access the creation time of the ObjectId,
using the [Link]() method; CORRECT, when we apply the
In mongoshell, we can access the creation time in ObjectId, through the use of
getTimestamp() method. And classify in a field _id that stores ObjectId values is
Correction of the examequivalent to the classification by creation time. The objective of this
approximately Fontsize Speak with the tutor
the issue is to know that in MongoDB, each document stored in a collection requires
a unique _id field that acts as the primary key. If an inserted document omits the
The _id field, the MongoDB driver automatically generates an ObjectId for the _id field. The Test Databases No
final Relational
MongoDB clients must add an _id field with a unique ObjectId.
Corrections 1 out of 10
ObjectIds for the _id field provide the following additional benefits: Returns a
The hexadecimal string representation of the object is related to the str attribute. Note 5 points

INCORRECT actually returns the hexadecimal string representation of the object. Generate
a new ObjectId using a unique hexadecimal string ObjectId() INCORRECT, in the Correct Wrong
generate a new ObjectId using a unique hexadecimal string ObjectId()
it is related to hexadecimal string. The [Link]() returns the part of the 1 2 3 4 5
timestamp ObjectId() as a [Link], in fact the
[Link]() returns the timestamp part of ObjectId() as a 6 7 8 9 10
Data is related to [Link]. The [Link]() returns the value of
ObjectId() as a lowercase hexadecimal string. This value is the str attribute of the object
ObjectId().INCORRECT, in fact [Link]() returns the value of ObjectId() Earlier Next
as a lowercase hexadecimal string. This value is the str attribute of the ObjectId() object.
is related to [Link]().
Question 5 Answered

Within the context of non-relational databases, we have the platform of


open source MongoDB, where it is mainly known as a database
document data, although in recent years it has moved to allow
a multi-model database approach (MONGODB, 2022).

In MongoDB, a record is a document stored in the format


binary (JSON), and its documents are grouped in what is called
collections

BECAUSE

II. Collections are analogous to tables in relational databases (or


traditional).

Regarding these assertions, mark the correct alternative.


Assertions I and II are true propositions, but II does not justify I.
Test correction
Fontsize Talk to the tutor

Test Databases No
final Relational
Assertion I is a false proposition and II is true. Corrections 1 of 10

Note 5 points

Correct Wrong

Assertion I is a true proposition and II is false. 1 2 3 4 5

6 7 8 9 10

Anterior Next
Assertions I and II are true propositions, and II justifies I.

Assertions I and II are false propositions.

Your answer
Assertion I is a true proposition and II is false.

Correct alternative: Assertions I and II are true propositions, but II does not justify the
I. Within the context of non-relational databases, we have the platform of
open source MongoDB, where it is mainly known as a database of
documents, although in recent years it has shifted to allow a banking approach
of multi-model data (MONGODB, 2022). In studies related to MongoDB, it is correct
What is stated in: I. In MongoDB, a record refers to a document stored in the
binary format (JSON), and your documents are grouped in what is called collections
(or collections). And in the following statement:
II. The collections are analogous to tables in relational (or traditional) databases. Therefore
both alternatives are correct, however the second is not a justification for the first, but
It's a comparison of what a collection is in MongoDB database in relation to the database.
from data of the SQL or relational type. Therefore, we have that assertions I and II are propositions.
true, but II does not justify I.
Question 6 No response

NoSQL databases allow developers to store


large amounts of unstructured data, giving them a lot of flexibility,
they differ because they provide a mechanism for storing and retrieving
unstructured data How NoSQL databases were designed to
solve scalability problems of SQL databases, they are free of
schemes based on distributed systems, making them easier to
dimension and fragment.

According to database studies, judge the statements below, and


mark the one that is CORRECT:

Document storage is a database that uses documents.


different where each one is associated with only one value in a
collection.
Line-oriented graphs are rarely used in data management.
warehouses.

Correction of the exam


Fontsize Talk to the tutor
Graph-based databases represent data similarly to
a graph of entities where each node of the graph is a piece of data.
Test Databases No
final Relational
Corrections 1 of 10

Note 5 points

Tuple-oriented databases are rarely used in time analysis.


Correct Wrong
real, restricting itself only to e-commerce.
1 2 3 4 5

6 7 8 9 10

One characteristic among NoSQL databases is the typology of


storage called tuples, this is a database whose collections Previous Next

they are specific dictionaries.

Your response
One characteristic among NoSQL databases is the type of storage called
tuples, this is a database whose collections are specific dictionaries.

Correct Alternative: Graph-based databases represent the data


similar to an entity graph where each node of the graph is a piece of data.
CORRECT. In this, the data is represented similarly to an entity graph where
Each node of the graph is a piece of data. The edges symbolize the relationship between the nodes.
Each edge and node has its unique identifier. This type is aimed at social networks,
logistics and spatial data. Documentary storage is a database that uses
different documents where each is associated with only one value in a collection.
INCORRECT. In fact, key-value storage is a database that
use different keys where each is associated with only one value in a collection,
do not present query language, and the commands to store, retrieve and
deleting data are respectively GET, PUT, and DELETE. Its simplified structure
makes key-value storage fast, easy to access, scalable, and portable.
Line-oriented chart and seldom used in data warehouse management
INCORRECT. In fact, we find that column-oriented storage is widely used in
data warehouse management, in business intelligence and fraud detection.
As the data is available in one column, this type tends to offer high
performance in aggregation queries. Tuple-oriented databases are scarce.
applied in real-time analyses, restricted only to e-commerce. INCORRECT.
In fact, document-oriented databases are well suited for uses of
real-time analyses, such as in e-commerce, content management system.
It is not recommended to apply in complex transactions with multiple operations or queries.
One characteristic of NoSQL databases is the type of storage called
tuples, this is a database whose collections are specific dictionaries. INCORRECT.
In fact, one characteristic among NoSQL databases is the typology of
storage called key-value, this is a database whose collections are
specific dictionaries in which each entry is associated with a restricted key of the
collection.
Question 7 No response

Apache Hadoop is a framework that allows for processing.


distributed from large datasets across computer clusters
using simple programming models (HADOOP, 2022).

Apache Hadoop is widely used in data processing projects.


One of its main components is MapReduce. About MapReduce, the
the Reduce function is responsible for

with the original data, make a partitioning so that it is


processed in parallel, reducing the larger problem into
subproblems.
with the partial results, derived from each process of the Map stage,
make the aggregation to have the final result.

with the partial results, stemming from each process of the Map stage,
create a partitioning so that it is processed in parallel,
reducing the larger problem into subproblems.

with the original data, make a partitioning so that it is


processed sequentially, reducing the larger problem into
subproblems.

with the partial results, arising from each process of the Map stage,
create a partitioning so that it can be processed sequentially,
reducing the larger problem into subproblems.
Correction of the test
Fontsize Talk to the tutor

Test Databases No
Your answer final Relational
Corrections 1 of 10
with the partial results, originating from each process of the Map stage, to make a
Note 5 points
partitioning to be processed in parallel, reducing the larger problem into
subproblems.
Correct Erroneous

Correct alternative: with the partial results, arising from each process of the stage 1 2 3 4 5

Map, perform the aggregation to achieve the final result. CORRECT, this is how it works.
Reduce. This issue focuses on covering the operation of Reduce, a component of 6 7 8 9 10
MapReduce. With the original data, create a partition so that it can be processed by
parallel way, reducing the bigger problem into subproblems. INCORRECT, Reduce
works with the partial data that was generated in the Map, and aggregates them to form the Anterior Next

final result. The description of the alternative is that of the Map. with the partial results, originating from
each process of the Map stage, make a partition so that it is processed in a way
parallel, reducing the larger problem into subproblems. INCORRECT, Reduce works with
the partial data, which were generated in the Map, and aggregates them to compose the final result.
the original data, to partition it so that it can be processed sequentially,
reducing the larger problem into subproblems. INCORRECT, Reduce works with the data
partials, which were generated in the Map, and aggregates them to compose the final result. with the
partial results, originating from each process of the Map stage, to make a partitioning for
that it should be processed sequentially, reducing the larger problem into subproblems.
INCORRECT, Reduce works with the partial data that were generated in the Map, and the
add to compose the final result.
Question 8 No response

Apache Hadoop is a framework that enables processing.


distributed from large datasets through computer clusters
using simple programming models (HADOOP, 2022).

The framework provides interfaces for developers to make their


implementations using already developed resources, bringing gains of
performance and productivity.

Taking into account the content about user interfaces seen in class,
Judge the following statements as (T) True or (F) False:

( ) Payload is one of the 6 categories of user interfaces.

( Job Configuration is one of the 6 categories of


user interfaces.
Sequential Job is one of the 6 categories of interfaces
user.

Job Submission and Monitoring is a


the 6 categories of user interfaces.
Correction of the exam
Fontsize Talk to the tutor

Select the alternative that presents the CORRECT sequence:


Test Databases No
final Relational
Corrections 1 of 10

Note 5 points

Correct Wrong

T - T - F - T. 1 2 3 4 5

6 7 8 9 10

Before Next
T - F - F - T.

V - F - V - V.
T - F - T - F.

T - T - F - F.

Your answer

V-V-F-F.

Correct Alternative: T - T - F - T. This question aims to cover the content of user interfaces.
no Hadoop MapReduce. ( V ) Payload is one of the 6 categories of interfaces
[Link]. Payload is part of the user interface categories. ( V ) Job
Configuration (Task Configuration) is one of the 6 categories of user interfaces.
[Link].(F)
Sequential Job (Sequential Task) is one of the 6 categories of user interfaces. False.
Sequential Job is not part of the user interface categories. ( V ) Job Submission and
Monitoring (Sending and monitoring tasks) is one of the 6 categories of interfaces of
[Link]. Job Submission is part of the user interface categories.
Question 9 No response

Within the context of non-relational databases, we have the platform of


open source MongoDB, which is one of the document-oriented databases
most popular documents under the banner of the NoSQL database. It was
developed from an idea in 2007 and its first version was released in
2010. It is developed and maintained by MongoDB Inc.

Regarding the main features of MongoDB, judge the following statements.


True (V) or False (F):

In MongoDB, a record refers to a document stored in the


binary format (JSON), and your documents are grouped in what is called
collections (or collections). The collections are analogous to tables in the database
relational (or traditional).

The main components of MongoDB are: Mongod, Mongos, and Mongosh.


Correction of the exam
MongoDB does not require a database management system. Fontsize Talk to the tutor

relational (RDBMS), therefore it provides a data storage model


Test Databases No
final Relational
elastic that allows users to store and query data types
Hits 1 out of 10
multivariate with ease.
Note 5 points

A document in MongoDB is equivalent to a record in a database.


traditional data. It consists of name and value fields. Each field is a Correct Erroneous

association between a name and a value and is similar to a column in a


1 2 3 4 5
relational database.

6 7 8 9 10
Select the option that presents the CORRECT sequence.

Anterior Next

V – V – F – F.

F – F – V – V.

T – F – T – F.
V – V – V – F.

V – V – V – V.

Your answer

F – F – V – V.

Correct alternative: T – T – T – T. Regarding the main characteristics of MongoDB, the


the following statements are respectively:
(V) In MongoDB, a record refers to a document stored in binary format.
and your documents are grouped into what is called collections.
Collections are analogous to tables in relational (or traditional) databases. True.
As justified in the explanation of the sentence and as stated in the notes of the
material used in this Unit and Section.
The main components of MongoDB are: Mongod, Mongos, and Mongosh. True.
As justified in the explanation of the sentence and as outlined in the notes of the
material used in these Unit and Section.
MongoDB does not require a relational database management system.
(RDBMS), so it provides an elastic data storage model that allows
Users store and query multivariate data types with ease. True.
As justified in the explanation of the sentence and as stated in the notes of
material used in these Unit and Section.
A document in MongoDB is equivalent to a record in a database.
traditional. It consists of name and value fields. Each field is an association between
a name and a value and is similar to a column in a relational database.
True.
As justified in the explanation of the sentence and as stated in the notes of
material used in this Unit and Section.
Question 10 No response

MongoDB is a persistent document-oriented database used for


store and process data in the form of documents. Just like others
database management systems, MongoDB allows management
interact with data through four fundamental types of operations
data.

Based on the studies of relational databases and their operations


data fundamentals, judge the following statements as (T) True or (F)
False.

CREATE DOCUMENT: To have data that you can practice reading,


updating and deleting, this step focuses on how to create documents of
data in MongoDB. When executing the insertOne() method, it will only insert the
document in the collection.

( ) READING DOCUMENTS: we can recover the document with a single


operation using the find() method.
( ) UPDATE DOCUMENTS: This stage focuses on how to update
existing documents modifying field values in individual documents and
adding a new field to each document in a collection.

( ) EXCLUDING DOCUMENTS: There are times when the data in the database
data become obsolete and need to be deleted. And the deleteOne() method
remove only the first document corresponding to the filter document
The deleteMany() method removes multiple objects at once.

Select the option that presents the CORRECT sequence.

V – V – F – F.

F – F – V – V.
T – F – T – F.

Correction of the exam


Fontsize Talk to the tutor

F – V – V – V. Test Databases No
final Relational
Corrections 1 out of 10

Note 5 points

Correct Wrong
V – V – V – V.
1 2 3 4 5

Your answer
6 7 8 9 10

V–V–F–F.
Previous Complete correction

Correct Alternative: F – V – V – V. (F) CREATE DOCUMENT: To have data that you


You can practice reading, updating, and deleting; this step focuses on how to create.
data documents in MongoDB. When executing the insertOne() method, it will only insert the
document in the collection. False. The correct would be to 'CREATE DOCUMENT: To have data
that you can practice reading, updating and deleting, this step focuses on how
create data documents in MongoDB. When executing the insertOne() method, it does not
it will not only insert the document into the collection but will also create the collection

automatically." (V) READING DOCUMENTS: we can retrieve the document with


a single operation using the find() method. True.
As justified in the explanation of sentence I and as stated in the
notes on the material used in this Unit and Section. (V)UPDATE
DOCUMENTS: This stage focuses on how to update existing documents by changing
field values in individual documents and adding a new field to each
document in a collection. True.
As justified in the explanation of sentence I and as stated in
notes on the material used in these Unit and Section. (V)EXCLUDING
DOCUMENTS: There are times when the data in the database becomes obsolete and
must be deleted. And the deleteOne() method removes only the first document
corresponding to the query filter document and the deleteMany() method, it deletes multiple
objects at once. True.
As justified in the explanation of sentence I and as stated in the
notes on the material used in this Unit and Section.

You might also like