nerdexam
MongoDB

C100DBA · Question #101

A collection and a document in MongoDB is equivalent to which of the SQL concepts respectively?

The correct answer is B. Table and Row. In MongoDB, a collection maps to a SQL table - both are containers that group related records together. A MongoDB document maps to a SQL row - both represent a single record or entry within that container. Why the distractors are wrong: A (Column and Row): Reverses the analogy an

MongoDB Fundamentals

Question

A collection and a document in MongoDB is equivalent to which of the SQL concepts respectively?

Options

  • AColumn and Row
  • BTable and Row
  • CDatabase and Table
  • DTable and Column

How the community answered

(28 responses)
  • A
    7% (2)
  • B
    86% (24)
  • C
    4% (1)
  • D
    4% (1)

Explanation

In MongoDB, a collection maps to a SQL table - both are containers that group related records together. A MongoDB document maps to a SQL row - both represent a single record or entry within that container.

Why the distractors are wrong:

  • A (Column and Row): Reverses the analogy and misidentifies the collection - columns are individual fields within a record, not containers for records.
  • C (Database and Table): Both MongoDB and SQL share the concept of a "database" at the top level, so this conflates two different levels of the hierarchy; a collection is inside a database, not equivalent to one.
  • D (Table and Column): Correctly identifies "table" but maps a document to a column, which is backwards - a column is a single field, while a document contains many fields.

Memory tip: Think of it this way - a collection holds cards (documents), just like a table holds tuples (rows). The outer container = table/collection; the inner record = row/document.

Topics

#collection#document#SQL equivalents#data model

Community Discussion

No community discussion yet for this question.

Full C100DBA Practice