Unit 6 - Practice Quiz

INT306 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 Which of the following best describes the primary scaling strategy for most NoSQL databases compared to traditional SQL databases?

A. Vertical Scaling (Scaling Up)
B. Horizontal Scaling (Scaling Out)
C. Diagonal Scaling
D. Static Scaling

2 In the context of the CAP theorem, which two guarantees do most NoSQL databases (like MongoDB in default configurations) typically prioritize?

A. Consistency and Availability
B. Consistency and Partition Tolerance
C. Availability and Partition Tolerance
D. Durability and Atomicity

3 Which data format does MongoDB use internally to store documents?

A. JSON
B. XML
C. BSON
D. YAML

4 In the structural hierarchy of MongoDB, a Table in RDBMS is equivalent to a ____ in MongoDB.

A. Document
B. Field
C. Collection
D. Cluster

5 What is the default field added by MongoDB to every document if the user does not provide one?

A. id
B. _id
C. key
D. primary_key

6 Which of the following statements about SQL vs NoSQL is FALSE?

A. SQL databases typically have a rigid, predefined schema.
B. NoSQL databases are generally schema-less or have flexible schemas.
C. SQL databases represent data in hierarchical structures like trees.
D. NoSQL databases are often better suited for unstructured or semi-structured data.

7 Amazon DynamoDB is best classified as which type of NoSQL database?

A. Graph Database
B. Key-Value and Document Database
C. Column-oriented Database
D. Relational Database

8 In a Serverless Cloud Database model, what is the user primarily responsible for managing?

A. Operating System patches
B. Server hardware provisioning
C. Application data and queries
D. Database engine installation

9 Which command is used to insert a single document into a MongoDB collection named users?

A. db.users.add({name: "John"})
B. db.users.insertOne({name: "John"})
C. db.users.push({name: "John"})
D. db.users.create({name: "John"})

10 Consider the following JSON snippet. Which data type does the key "isStudent" represent?

{
"name": "Alice",
"isStudent": false
}

A. String
B. Boolean
C. Integer
D. Array

11 Which of the following JSON structures is syntactically INVALID?

A. { "name": "John", "age": 30 }
B. { 'name': 'John', 'age': 30 }
C. { "scores": [10, 20, 30] }
D. { "address": { "city": "NY" } }

12 In MongoDB, which operator is used to set the value of a field in a document during an update?

A. $add
B. $set
C. $push
D. $group

13 How does MongoDB store the relationship between data in a normalized data model typically used in SQL (Foreign Keys)?

A. It uses JOIN commands strictly.
B. It uses Pointers.
C. It uses References (Manual References or DBRefs) or Embedded Documents.
D. It does not support relationships.

14 What is the primary function of an Index in a database?

A. To encrypt the data.
B. To compress the data storage size.
C. To improve the speed of data retrieval operations.
D. To validate the schema of incoming data.

15 In MongoDB, what does the db.collection.explain("executionStats") command provide?

A. A summary of the collection size.
B. Details about the query plan and execution statistics (like keys examined vs docs examined).
C. A list of all users with access to the collection.
D. The schema validation rules for the collection.

16 If a MongoDB query creates a COLLSCAN, what does this indicate regarding performance?

A. The query used an index efficiently.
B. The query failed to execute.
C. The query had to scan every document in the collection (Collection Scan).
D. The query used a covered index.

17 Which of the following is a characteristic of Vector Databases?

A. They store data strictly in rows and columns.
B. They are optimized for storing and searching high-dimensional vector embeddings.
C. They only support exact keyword matching.
D. They do not support JSON.

18 What is an Embedding in the context of Vector Databases?

A. Embedding a document inside another document.
B. A numerical representation of data (like text or images) in a high-dimensional space.
C. A type of HTML tag.
D. The process of installing the database.

19 Which search technique is primary used by Vector Databases to find similar items?

A. Exact keyword matching
B. Regular Expression matching
C. Nearest Neighbor Search (e.g., k-NN or ANN)
D. Primary Key lookup

20 In DynamoDB, what is the composition of the Primary Key?

A. Only a Partition Key
B. Only a Sort Key
C. Either a Partition Key or a Composite Key (Partition Key + Sort Key)
D. A Foreign Key

21 Which SQL statement is equivalent to the MongoDB query: db.users.find({ age: { $gt: 25 } })?

A. SELECT * FROM users WHERE age = 25
B. SELECT * FROM users WHERE age > 25
C. SELECT * FROM users WHERE age < 25
D. UPDATE users SET age = 25

22 What does the acronym BASE stand for in NoSQL properties?

A. Basic Availability, Soft state, Eventual consistency
B. Big Availability, Solid state, Exact consistency
C. Binary Atomicity, Structural efficiency, Eventual consistency
D. Backup Availability, Soft storage, Encrypted consistency

23 In a JSON document, which character is used to separate keys from values?

A. Comma ,
B. Colon :
C. Semicolon ;
D. Equal sign =

24 Which MongoDB command removes a collection named logs and all its documents?

A. db.logs.remove()
B. db.logs.drop()
C. db.logs.delete()
D. db.logs.erase()

25 What is the result of using db.collection.createIndex({ username: 1 }) in MongoDB?

A. It creates a descending index on the username field.
B. It creates an ascending index on the username field.
C. It creates a text index on the username field.
D. It validates that the username is unique.

26 In DynamoDB, what determines the partition in which an item is stored?

A. The Sort Key
B. The Partition Key
C. The Item Size
D. The Creation Date

27 When querying a Vector Database, if vector and vector have a cosine similarity of 1, what does this imply?

A. They point in exactly opposite directions.
B. They are orthogonal (independent).
C. They differ by 90 degrees.
D. They point in the exact same direction (identical semantic meaning).

28 Which of the following JSON arrays correctly represents a list of integers?

A. [1; 2; 3]
B. {1, 2, 3}
C. [1, 2, 3]
D. ("1", "2", "3")

29 In MongoDB, which method allows you to select only specific fields to be returned in the result set?

A. Selection
B. Projection
C. Reflection
D. Injection

30 Which SQL concept is most similar to an Embedded Document in NoSQL?

A. Denormalization
B. Normalization
C. Outer Join
D. Transaction

31 What is the main advantage of Serverless databases regarding capacity planning?

A. They require strict pre-provisioning of storage.
B. They scale automatically based on workload, eliminating manual capacity management.
C. They are cheaper even if unused.
D. They allow access to the underlying OS.

32 Which operator is used to perform a logical OR in MongoDB queries?

A. $or
B. $either
C. ||
D. $union

33 In the context of JSON, what is a "key"?

A. A number identifying the row.
B. A string that acts as the identifier for a value.
C. An encrypted password.
D. The closing bracket of an object.

34 Which index type in MongoDB is required to support efficient queries on geospatial data?

A. Text Index
B. Hashed Index
C. 2dsphere Index
D. Unique Index

35 Consider a MongoDB collection products. How do you update the price of a product with _id: 101 to 500?

A. db.products.update({_id: 101}, {price: 500})
B. db.products.updateOne({_id: 101}, {$set: {price: 500}})
C. db.products.find({_id: 101}).set({price: 500})
D. db.products.replace({_id: 101}, {price: 500})

36 What is a Compound Index?

A. An index on a single field containing an array.
B. An index structure that holds references to multiple collections.
C. An index on two or more fields in a single document.
D. An index that compresses data.

37 Which of the following scenarios is LEAST suitable for a Vector Database?

A. Semantic search engine
B. Recommendation system
C. Standard transaction processing (banking ledger)
D. Image similarity search

38 In JSON, an ordered list of values is known as:

A. Object
B. Array
C. Tuple
D. Dictionary

39 What is the maximum size of a BSON document in MongoDB?

A. 4 MB
B. 8 MB
C. 16 MB
D. Unlimited

40 Which MongoDB method is used to aggregate data (similar to GROUP BY in SQL)?

A. db.collection.group()
B. db.collection.aggregate()
C. db.collection.sum()
D. db.collection.gather()

41 In a DynamoDB global table, how is data consistency handled across regions?

A. Strong consistency immediately.
B. Eventual consistency via replication.
C. Manual file transfer.
D. No replication occurs.

42 When interpreting explain() output, what does the ratio of totalKeysExamined to totalDocsExamined tell you?

A. The network latency.
B. The efficiency of the index coverage.
C. The number of users connected.
D. The disk space used.

43 Which data type is NOT natively supported in standard JSON?

A. String
B. Number
C. Date
D. Null

44 To perform a text search in MongoDB, what must be created first?

A. A B-Tree index
B. A Text Index
C. A Compound Index
D. A Primary Key

45 Which symbol represents the start of a JSON Object?

A. [
B. {
C. <
D. (

46 In the context of Vector Databases, what is HNSW?

A. High Network Storage Width
B. Hierarchical Navigable Small World (an indexing algorithm)
C. Hyper NoSQL Web interface
D. A hashing function for passwords

47 What is the primary benefit of 'Sharding' in MongoDB?

A. Data encryption
B. High Availability via copies
C. Distributing data across multiple machines to support large datasets (Horizontal Scaling)
D. Automatic backups

48 Which of the following query operators allows finding values contained in an array (e.g., tags)?

A. $in
B. $eq
C. $like
D. $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?

A. SQL / RDBMS
B. NoSQL / Document Store
C. Flat File
D. Network Model

50 Which MongoDB command displays the list of databases on the server?

A. show tables
B. show dbs
C. list databases
D. db.all()