NOSQL BASICS| COMPUTER SCIENCE |, Exams of Computer Science

NOSQL BASICS| COMPUTER SCIENCE | NOSQL BASICS| COMPUTER SCIENCE |

Typology: Exams

2025/2026

Available from 04/17/2026

christine-boyle
christine-boyle šŸ‡ŗšŸ‡ø

3.6

(7)

3.4K documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
NOSQL BASICS| COMPUTER
SCIENCE |
Relational databases focus on ___ through ___. - Answer-Data consistency...
transactions
What data model is used by Redis, Riak, BerekleyDB and LevelDB? - Answer-Key-
Value
What data model is used by MongoDB, CouchDB, OrientDB and Terrastore? - Answer-
Document
What data model is used by Amazon SimpleDB, Cassandra, HBase and Hypertable? -
Answer-Column-Family
What data model is used by FlockDB, HyperGraphDB, Neo4J and OrientDB? - Answer-
Graph
NoSQL database - Answer-Generally refers to non-relational databases; databases
that store and manipulate data in formats other than tabular relations
Common characteristics of NoSQL databases - Answer-1. Provide data models that
better fit application needs, reducing mapping and data between applications and
databases
2. Do not use SQL; some NoSQL databases have their own query language but there is
no notion of a standard query language for NoSQL databases.
3. Generally open-source projects
4. Most are designed to run on clusters, making them a better fit for big data scenarios.
5. Operate without a schema, allowing the creation of fields to databqse records without
having to define any change in structure first.
Which NoSQL data model uses a distribution model similar to relational databases? -
Answer-Graph databases
NoSQL databases are categorized according to their ___. - Answer-Data model
Key-value databases - Answer-* Simplest NoSQL databases from an API perspective
* Each entry has a key and a value
* Keys and values are flexible and can be represented by any format
T or F: Both keys and values in a key-value store are flexible and can be represented by
any format. - Answer-TRUE
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download NOSQL BASICS| COMPUTER SCIENCE | and more Exams Computer Science in PDF only on Docsity!

NOSQL BASICS| COMPUTER

SCIENCE |

Relational databases focus on ___ through ___. - Answer -Data consistency... transactions What data model is used by Redis, Riak, BerekleyDB and LevelDB? - Answer -Key- Value What data model is used by MongoDB, CouchDB, OrientDB and Terrastore? - Answer - Document What data model is used by Amazon SimpleDB, Cassandra, HBase and Hypertable? - Answer -Column-Family What data model is used by FlockDB, HyperGraphDB, Neo4J and OrientDB? - Answer - Graph NoSQL database - Answer -Generally refers to non-relational databases; databases that store and manipulate data in formats other than tabular relations Common characteristics of NoSQL databases - Answer -1. Provide data models that better fit application needs, reducing mapping and data between applications and databases

  1. Do not use SQL; some NoSQL databases have their own query language but there is no notion of a standard query language for NoSQL databases.
  2. Generally open-source projects
  3. Most are designed to run on clusters, making them a better fit for big data scenarios.
  4. Operate without a schema, allowing the creation of fields to databqse records without having to define any change in structure first. Which NoSQL data model uses a distribution model similar to relational databases? - Answer -Graph databases NoSQL databases are categorized according to their ___. - Answer -Data model Key-value databases - Answer -* Simplest NoSQL databases from an API perspective
  • Each entry has a key and a value
  • Keys and values are flexible and can be represented by any format T or F: Both keys and values in a key-value store are flexible and can be represented by any format. - Answer -TRUE

T or F: In a key-value database, you can have two rows with the same key. - Answer - FALSE; keys are unique. You can never have two rows with the same key. In a key-value database, you can not perform queries on the ___. - Answer -Values; you cannot select a key-value pair using the value part. ___ can be image names, web page URLs, file paths and SQL queries that point to ___ like binary images, HTML web pages, PDF documents or SQL query results. - Answer - Keys... values A key-value database is indexed by the ___. - Answer -Key What are the operations that application developers use to access and manipulate a key-value store? - Answer -PUT, GET and DELETE Key-value databases do not care about the ___ that are stored. It is the responsibility of ___ to understand what is stored. - Answer -Values... application Document databases - Answer -* Store data in structured documents, usually XML, JSON and BSON formats

  • Documents are self-describing and have hierarchical tree data structures ___ allow some form of structure without enforcing a schema, thus providing a balance between the rigid schema of the relational database and the completely schema-less key-value database. - Answer -Document databases T or F: The key in a document database may be a simple ID, which is never used or seen. - Answer -TRUE T or F: You must use the key to query the content in a document database. - Answer - FALSE; You can get almost any item out of a document database by querying the content of the document. Since documents are searchable, document databases can quickly extract subsections of a large number of documents without loading each document into memory. Document databases have a ___ structure. - Answer -Tree-like; document trees have a single root element. Beneath the root element, there is a sequence of branches, sub branches and values. Each branch has a related path expression that shows you how to navigate from root of the tree to any given branch, sub branch and value. ___ databases are a precursor to modern JSON document databases. - Answer -XML (extensible markup language)

How is data for a specific column family stored in a specific column-family database? - Answer -Data is stored together on a disk to optimize disk input/output operations, with the assumption that data for a particular column family will be usually accessed together. What is the advantage and disadvantage of storing data for a specific column family on a single disk? - Answer -The advantage is that we can easily access and retrieve all values of a certain column family. The disadvantage is that retrieving all attributes pertaining to a single record becomes more difficult because different column families can be stored in different machines. T or F: In a column-family database, you do not need to fully design your data model before you begin inserting data. - Answer -TRUE; columns are dynamically created upon insertion of new data. In this way, column family databases are similar to key- value stores. Unlike relational databases, you do not have to insert data in to all ___ for each ___ when using column-family databases. - Answer -Columns...row What allows column-family databases to contain tables that are sparse (i.e. do not contain values at the intersection of each row and column)? - Answer -The fact that, unlike relational databases, empty cells or null values in a column-family database do not consume any storage space. What serves as the key for data lookup in a column-family database? - Answer -A key (unique address used to look up the value of a cell) is formed with the following:

  1. Rowkey
  2. Column family
  3. Column name T or F: Values of a cell cannot contain multiple versions of data. - Answer -FALSE; the value of a cell can contain multiple versions of data indexed by timestamps. For instance, if we are capturing the temperature readings in a city in different times, the value of a cell can contain multiple values. What are the use cases for a column-family database? - Answer -1. Event logging
  4. Blogging platforms
  5. Geographic info systems What are the basic queries that can be run against a Cassandra database? - Answer - SET, GET and DELETE

T or F: The query language used by Cassandra databases to form SQL-like queries does not allow joins or subqueries. - Answer -TRUE Graph Database - Answer -* Allow us to store entities (nodes) and relationships (edges) between these entities

  • Edges have directional significance (like Instagram followers), allowing us to find patterns between notes Notes are connected to each other by ___. - Answer -Edges In a graph database, edges and nodes can both have ___. - Answer -Properties In a graph data model, what term is synonymous with querying the database? - Answer -Traversing the graph What is the primary use case for a graph database? - Answer -Link analysis to look for patterns in social networks, telephone/email records, fund transfers, recommender systems, etc. Why are graph databases a poor choice when running on cluster? - Answer -When a node points to an adjacent node located on another machine, the overhead of routing the traversal across multiple machines eliminates the advantages of the graph database model. This is because inter-server communications is far more time-consuming than local access. ___ do not support distributed deployment and must run on a single server only. - Answer -Graph Cypher - Answer -Graph query language used by Neo4j that is particularly optimized for graph traversals. Neo4j - Answer -The most widely adopted graph database. MongoDB is a ___ database. - Answer -Document-oriented What replaces the concept of a row/record in MongoDB? - Answer -A document Document - Answer -A data structure composed of field and value pairs MongoDB stores its data in ___. - Answer -Collections Each MongoDB database consists of one or more ___, which hold one or more ___ documents. - Answer -Collections... BSON Key features of MongoDB - Answer -1. High performance

How does MongoDB facilitate aggregation operations? - Answer -The aggregation pipeline, which is similar to Group By clause in SQL T or F: The name of the field that serves as the primary key in a MongoDB database is the same across collections. - Answer -TRUE; This is different from relational databases in which we can choose the primary key field. What is the equivalent of a table join in MongoDB? - Answer -Embedded Documents and $lookup MongoDB stores data records as ___. - Answer -BSON documents What is the maximum BSON document size? - Answer -16 megabytes MongoDB documents are composed of ___. - Answer -Field-value pairs What datatypes can the value of a field in a MongoDB BSON document be? - Answer - Any of the BSON data types, including:

  • Other documents
  • Arrays
  • Arrays of documents
  • String
  • Number
  • Boolean
  • Objects What is a BSON document? - Answer -A binary representation of a JSON object How can you decipher when a MongoDB document begins and ends? - Answer -By looking for the opening and closing curly brackets, which indicate the beginning and end of the document. T or F: Fields in MongoDB can be any data type. - Answer -FALSE; MongoDB fields must be strings How are MongoDB fields and values separated from one another in a document? - Answer -Colons How are MongoDB field-value pairs separated from one another? - Answer -Commas Why don't we use JSON data types in MongoDB? - Answer -JSON data types are somewhat limited. It only has one number type and doesn't not support dates. BSON extends JSON data types to include integers, doubles, dates and binary data.

T or F: Documents in a MongoDB database must have the same set of fields and datatypes must be the same across fields - Answer -FALSE; MongoDB documents do not need to have the same set of fields nor do the data types for a field need to be the same across documents. Normalized Data Models - Answer -Data model in which parent and child documents are in different collections. Embedded Data Models - Answer -Data model in which parent and child documents are in the same collection What is the key challenge in modeling a MongoDB database? - Answer -Balancing the needs of the application, the performance characteristics of the database engine and the data retrieval patterns. What is the most important thing to keep in mind when designing a MongoDB database? - Answer -The application usage of the data (i.e. queries, updates and processing of the data) What is the key decision in designing data models for MongoDB? - Answer -Choosing the structure of documents and how the applications represent the relationships between data. What are the two ways to represent the relationships between data in a MongoDB database? - Answer -1. Normalized data models

  1. Embedded data models A normalized data model describes relationships using ___ between documents. - Answer -References In a MongoDB database using a normalized data model, how do references store the relationships between data? - Answer -By including links from one document to another; applications can resolve these references to access the relate data. In the example shown, if the application needs to obtain the phone number of a user with the user name 123xyz, it will follow the link between the user and contact documents for this user. What is the primary advantage and disadvantage of using a normalized data model with MongoDB? - Answer -Normalize data models using references provide more flexibility than embedded data models. However, client-side applications must issue follow-up queries to resolve the references. In other words, normalized data models require more round trips to the database server.

String - Answer -A MongoDB data type that represents any string of UTF-8 characters (value is given in quotes) {x: "database"} Double - Answer -A MongoDB data type that is a 64-bit floating point value (default number type) {x: 3.14} NumberInt - Answer -A MongoDB data type that is a 32-bit integer (value is given in quotes) {x: NumberInt("3")} NumberLong - Answer -A MongoDB data type that is a 64-bit integer (value is given in quotes) {x: NumberLong("3")} NumberDecimal - Answer -A MongoDB data type tat represents a 128-bit floating point value (value is given in quotes) {x: NumberDecimal("3.14")} Boolean - Answer -A MongoDB data type that is used for true or false values {x: true} Date - Answer -A MongoDB data type used to represent dates {x: new Date("01/01/2017")} ObjectID - Answer -A MongoDB data type that is used as the default type for the _id field (12-byte hexadecimal string) {x: ObjectID()} Array - Answer -A MongoDB datatype that serves as a representation of a set of values {x: ["a", "b", "c"]} Embedded Document - Answer -MongoDB document representing the value of a field {x: {title: "abc", quantity: 25}}

T or F: The MongoDB data object represents a date object in a standard ISO format, which can still be used in arithmetic operations. - Answer -FALSE; MongoDB stores dates as milliseconds since Jan. 1, 1970. The new Data() wrapper allows us to use the dates in the way described. Field names are always represented as ___. - Answer -A string Restrictions for field names in MongoDB - Answer -1. The field name _id is reserved for use as a primary key

  1. Field names cannot start with the dollar sign ($) character
  2. The field names cannot contain the dot (.) character
  3. The field names cannot contain the null character Characteristics of _id field values - Answer -1. It's value must be unique in a collection
  4. It is immutable
  5. May be any data type other than an array T or F: The following field values will be interpreted as the same in MongoDB {number: 3} {number: "3"} - Answer -FALSE; field values in MongoDB are type-sensitive. In this example, while the data type of the number field in the first document is double, and the data type of the number field in the second document is string. Hence, these two documents are not the same. T or F: The following field names will be interpreted differently in MongoDB {name: "Alex"} {Name: "Alex"} - Answer -TRUE; field names in MongoDB are case-sensitive Since field names are case sensitive, these two fields are different. Hence, documents containing them are different as well. NOTE: This is different than Oracle SQL. How do you refer to a field of an embedded document in MongoDB? - Answer -1. Concatenate the embedded document name with the dot (.) and field name
  6. Enclose the value in quotes How do you refer to an element of an array in MongoDB? - Answer -1. Concatenate the array name with the dot (.) and zero-based index position
  7. Enclose the value in quotes Each ___ stored in a ___ requires an ___ field and its value must be ___. - Answer - Document... collection.. _id.. unique

show dbs; - Answer -When executed in Mongo shell, this command shows the existing databases use aggregations; - Answer -When executed in Mongo shell, this command allows you to switch to aggregations database and set db to agregations show collections; - Answer -When executed in Mongo shell, this command shows you the collections in the current database What is the primary access point to your MongoDB server through shell? - Answer -The global variable db to which your database connection is assigned. Upon startup, shell connects to the ___ on a MongoDB server and assigns this database connection to the ___. - Answer -Test database... global variable db How do you switch to another database in Mongo shell? - Answer -Issue the use command