Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the transactions collection of documents below, where each document represents one transaction made on a stock exchange: either buying or selling stocks. { date:

Consider the transactions collection of documents below, where each document represents one transaction made on a stock exchange: either buying or selling stocks.
{
"date": {"$date": 1325030400000},
"amount": 1197,
"transaction_code": "sell",
"symbol": "nvda",
"price": "12.73",
"total": "15241.40"
},
{
"date": {"$date": 1465776000000},
"amount": 8797,
"transaction_code": "buy",
"symbol": "nvda",
"price": "46.53",
"total": "409401.22"
},
{
"date": {"$date": 1472601600000},
"amount": 6146,
"transaction_code": "sell",
"symbol": "ebay",
"price": "32.11",
"total": "197384.99"
},
{
"date": {"$date": 1101081600000},
"amount": 253,
"transaction_code": "buy",
"symbol": "amzn",
"price": "37.77",
"total": "9556.92"
},
{
"date": {"$date": 1022112000000},
"amount": 4521,
"transaction_code": "buy",
"symbol": "nvda",
"price": "10.76",
"total": "48659.83"
},
{
"date": {"$date": 936144000000},
"amount": 955,
"transaction_code": "buy",
"symbol": "csco",
"price": "27.99",
"total": "26732.49"
}
If this query was executed on this collection:
db.transactions.find({ $and: [{transaction_code":"buy"},
{$and: [{ price: { $lte: 45.50}},{ price: { $gte: 15.50}}]}]
})
How many documents would be returned?
Group of answer choices
2
4
3
1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions

Question

b. Where did they come from?

Answered: 1 week ago