Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 12 pages
Exam (elaborations)

DBMS EXAM 3 QUESTIONS AND ANSWERS

Document preview thumbnail
Preview 2 out of 12 pages

DBMS EXAM 3 QUESTIONS AND ANSWERS

Content preview

DBMS EXAM 3 QUESTIONS AND
ANSWERS


Write a filter to return all documents where the listed property type is Chalet and the
chalet has at least 1 bedroom. - Correct Answers -{property_type: "Chalet", bedrooms:
{$gte: 1}}

Write a filter that returns all documents that are located in Turkey and where the host is
classified as a superhost. - Correct Answers -{"host.host_is_superhost": true,
"address.country": "Turkey"}

Write a filter to return all documents where the property type is Apartment and that have
exactly 5 amenities. - Correct Answers -{property_type: "Apartment", amenities: {$size:
5}}

Write a filter to return all documents that can accommodate exactly 2 people. - Correct
Answers -{accommodates: 2}

Write a filter to return all documents where the cancellation policy is "moderate" and the
price is less than $50. - Correct Answers -{cancellation_policy: "moderate", price: {$lt:
50}}

Write a filter to return all documents where the amenities contain "TV" and "Wifi". -
Correct Answers -{amenities: {$all: ["TV", "Wifi"]}}

Write a filter to return all documents where the number of bedrooms is not provided (null
or undefined). - Correct Answers -{"bedrooms": null}

Write a filter to return all documents where the host location is "Montreal, Quebec,
Canada" and the host has been verified via a "government_id" and a "phone". - Correct
Answers -{"host.host_location": "Montreal, Quebec, Canada",
"host.host_verifications": {$all: ["government_id", "phone"]}}

Write a filter to return all documents where the property type is Serviced apartment and
have a cleanliness review score > 9. - Correct Answers -{"property_type": "Serviced
apartment",
"review_scores.review_scores_cleanliness": {$gt: 9}}

Write a filter to return all documents where cancellation policy is "flexible" or
"super_strict_60" and picture urls for images are provided. - Correct Answers -
{cancellation_policy: {$in: ["flexible", "super_strict_60"]}, "images.picture_url": {$exists:
true, $ne: ""}}

, Write a filter to return all documents mentioning the word "clean" in the reviews and
having a review score cleanliness greater than 9. - Correct Answers -{reviews:
{$elemMatch: {comments: {$regex: 'clean'}}},
"review_scores.review_scores_cleanliness": {$gt: 9}}

Write a filter to return all documents with property type "Resort" that have all of the
following amenities: "Wifi", "Hot tub", "Wheelchair accessible". - Correct Answers -
{property_type: "Resort", amenities: {$all: ["Wifi", "Hot tub", "Wheelchair accessible"]}}

Write a filter to return all documents where the host name is "Ali", and the identity is
verified.(host_identity_verified) - Correct Answers -{"host.host_name": "Ali",
"host.host_identity_verified": true}

Write a filter to return all documents where the first amenity listed is "Wifi". - Correct
Answers -{"amenities.0": "Wifi"}

Write a filter to return all documents where one of the amenities begins with the letter
'H". - Correct Answers -{amenities: {$elemMatch: {$regex: "(?i)^H"}}}

Write a filter that returns all documents that have a market equal to: "Hong Kong", "New
York", "Porto", "Sydney" or "Istanbul" in the address field. - Correct Answers -
{"address.market": {$in: ["Hong Kong", "New York", "Porto", "Sydney", "Istanbul"]}}

Find all documents where genre is Drama - Correct Answers -{genres: "Drama"}

Find all movies where genre is Drama - Correct Answers -{genres: "Drama", type:
"movie"}

Find all movies where the genre is Drama or History - Correct Answers -{$or: [{genres:
"Drama}, {genres: "History"}]}

Find all movies where the genre is Drama and History - Correct Answers -{genres: {$all:
{"Drama", "History"]} type: "movie"}

Find movies with 2 genres - Correct Answers -{genres: {$size:2}}

Find all documents where the imdb.id is between 20000 and 40000 - Correct Answers -
{'imdb.id': {$gte: 20000, $lte: 40000}}

What is the hierarchy of MongoDB? - Correct Answers -Instace has databases has
collections has documents has fields and attributes

MongoDB doesn't have a (DDL / DML); why? - Correct Answers -DDL; each object has
its own structure, so no need for data definition language

Document information

Uploaded on
February 10, 2026
Number of pages
12
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
millyphilip
3.6
(555)
Sold
2958
Followers
1963
Items
45798
Last sold
2 days ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions