Final question 1

{ year: 1828, winner: “Andrew Jackson”, winner_running_mate: “John C. Calhoun”, winner_party: “Democratic”, winner_electoral_votes: 178, total_electoral_votes: 261 }

total_electoral_votes represents the total number of electoral votes that year, and winner_electoral_votes represents the number of electoral votes received by the winning candidates.

Which of the following queries will retrieve all the Republican winners with at least 160 electoral votes?

question means about filtering documents with winner party as “Republicans” and total_electoral_votes polled to be atleast 160?
or winner_margin must be atleast 160?

3 Likes

+1. Same doubt.

I think it is winner_electoral_votes because there is no query in option like minus winning votes from total and it actually doesn’t matter if just total votes are more than 160. what matters is if winning party votes are more than 160, then only they can be a winner.

Same doubt too. :roll_eyes:

I was pretty confident in my answer until I read this

Yeap, came to he discussion regarding this question.
The question on it’s own (from the db perspective) isn’t difficult at all, but one can easily make mistake by querying by one field, over the other.

I think we need more clarifications on this one.

Guys dont get confused, I got clarity now,.

Take a scenario if total_votes_polled is at least 160 like that means we are not sure whether winning votes is also atleast160.

But if we consider winner_total_votesatleast 160 means then atleast with 160 votes winner party is decided. Query according

+1. Same doubt. :face_with_raised_eyebrow:

Don’t stress on it or any of the other questions too much. If you need the forum to help you with your final exam then this means that you are not confident in your knowledge gained here, it is better to fail the test and take the course again compared to pass with flying colors but lack the ability to solve NoSQL(mongodb) issues on your own. And back to the topic: it is winner field most definitely.

P.S. If you need the certificate just to show it to your boss and forget about the whole thing then of course, you should use any help you can get in order to avoid being scolded for no reason!

1 Like