Unit 6 - Practice Quiz
1 Which of the following best describes the primary scaling strategy for most NoSQL databases compared to traditional SQL databases?
2 In the context of the CAP theorem, which two guarantees do most NoSQL databases (like MongoDB in default configurations) typically prioritize?
3 Which data format does MongoDB use internally to store documents?
4 In the structural hierarchy of MongoDB, a Table in RDBMS is equivalent to a ____ in MongoDB.
5 What is the default field added by MongoDB to every document if the user does not provide one?
id
_id
key
primary_key
6 Which of the following statements about SQL vs NoSQL is FALSE?
7 Amazon DynamoDB is best classified as which type of NoSQL database?
8 In a Serverless Cloud Database model, what is the user primarily responsible for managing?
9
Which command is used to insert a single document into a MongoDB collection named users?
db.users.add({name: "John"})
db.users.insertOne({name: "John"})
db.users.push({name: "John"})
db.users.create({name: "John"})
10
Consider the following JSON snippet. Which data type does the key "isStudent" represent?
{
"name": "Alice",
"isStudent": false
}
11 Which of the following JSON structures is syntactically INVALID?
{ "name": "John", "age": 30 }
{ 'name': 'John', 'age': 30 }
{ "scores": [10, 20, 30] }
{ "address": { "city": "NY" } }
12 In MongoDB, which operator is used to set the value of a field in a document during an update?
$add
$set
$push
$group
13 How does MongoDB store the relationship between data in a normalized data model typically used in SQL (Foreign Keys)?
14 What is the primary function of an Index in a database?
15
In MongoDB, what does the db.collection.explain("executionStats") command provide?
16 If a MongoDB query creates a COLLSCAN, what does this indicate regarding performance?
17 Which of the following is a characteristic of Vector Databases?
18 What is an Embedding in the context of Vector Databases?
19 Which search technique is primary used by Vector Databases to find similar items?
20 In DynamoDB, what is the composition of the Primary Key?
21
Which SQL statement is equivalent to the MongoDB query: db.users.find({ age: { $gt: 25 } })?
SELECT * FROM users WHERE age = 25
SELECT * FROM users WHERE age > 25
SELECT * FROM users WHERE age < 25
UPDATE users SET age = 25
22 What does the acronym BASE stand for in NoSQL properties?
23 In a JSON document, which character is used to separate keys from values?
,
:
;
=
24
Which MongoDB command removes a collection named logs and all its documents?
db.logs.remove()
db.logs.drop()
db.logs.delete()
db.logs.erase()
25
What is the result of using db.collection.createIndex({ username: 1 }) in MongoDB?
26 In DynamoDB, what determines the partition in which an item is stored?
27 When querying a Vector Database, if vector and vector have a cosine similarity of 1, what does this imply?
28 Which of the following JSON arrays correctly represents a list of integers?
[1; 2; 3]
{1, 2, 3}
[1, 2, 3]
("1", "2", "3")
29 In MongoDB, which method allows you to select only specific fields to be returned in the result set?
30 Which SQL concept is most similar to an Embedded Document in NoSQL?
31 What is the main advantage of Serverless databases regarding capacity planning?
32 Which operator is used to perform a logical OR in MongoDB queries?
$or
$either
||
$union
33 In the context of JSON, what is a "key"?
34 Which index type in MongoDB is required to support efficient queries on geospatial data?
35
Consider a MongoDB collection products. How do you update the price of a product with _id: 101 to 500?
db.products.update({_id: 101}, {price: 500})
db.products.updateOne({_id: 101}, {$set: {price: 500}})
db.products.find({_id: 101}).set({price: 500})
db.products.replace({_id: 101}, {price: 500})
36 What is a Compound Index?
37 Which of the following scenarios is LEAST suitable for a Vector Database?
38 In JSON, an ordered list of values is known as:
39 What is the maximum size of a BSON document in MongoDB?
40
Which MongoDB method is used to aggregate data (similar to GROUP BY in SQL)?
db.collection.group()
db.collection.aggregate()
db.collection.sum()
db.collection.gather()
41 In a DynamoDB global table, how is data consistency handled across regions?
42
When interpreting explain() output, what does the ratio of totalKeysExamined to totalDocsExamined tell you?
43 Which data type is NOT natively supported in standard JSON?
44 To perform a text search in MongoDB, what must be created first?
45 Which symbol represents the start of a JSON Object?
[
{
<
(
46 In the context of Vector Databases, what is HNSW?
47 What is the primary benefit of 'Sharding' in MongoDB?
48 Which of the following query operators allows finding values contained in an array (e.g., tags)?
$in
$eq
$like
$has
49 If you need to store data with varying fields per document (e.g., Product A has 'Voltage', Product B has 'Fabric Type'), which database is most naturally suited?
50 Which MongoDB command displays the list of databases on the server?
show tables
show dbs
list databases
db.all()