Question

In: Computer Science

covert to MongoDB NoSQL a. In 1990, in what games and what Seattle players had interceptions...

covert to MongoDB NoSQL

a. In 1990, in what games and what Seattle players had interceptions in a game?

Select games.game_number, profiles.name from games, profiles where games.defense_interceptions <>0 and games.team=”SEA” and games.year=”1990” and games.player_id = profiles.player_id;

b. For each year played, list a count of games in which John David Crow played.

select year, count(*) from profiles natural join games where name=”John David Crow” group by year;

Solutions

Expert Solution

a.

db.games,profiles .find({

   "$and": [{
       "games.defense_interceptions <":{ "$gt" : 0 }
   },{
   "$and": [{
       "$where": "this. games.team == this.”SEA” "
   },{
   "$and": [{
       " games.year" : ”1990”
   },{   "$where": "this. games.player_id == this. profiles.player_id"
   }]
   }]
   }]
},{
   "games.game_number": 1,
   "profiles.name": 1
}
);

b.

db.profilesnatural join games .group({

"key":{
"year": true
},
"initial": {
"countstar":0
},
"reduce": function( obj , prev ){

if (true != null ) if ( true instanceof Array)prev.countstar += true.length;
else prev.countstar++;

},
"finalize": function( prev ){

},
"cond": {
   "$where": "this.name == this.”John David Crow” "
}

});


Related Solutions

Compare the Data Modeling difference between relational database and NoSQL MongoDB.
Compare the Data Modeling difference between relational database and NoSQL MongoDB.
MONGODB Question (Similar to JSON) NOSQL QUESTION 1. Describe a scenario and write a query that...
MONGODB Question (Similar to JSON) NOSQL QUESTION 1. Describe a scenario and write a query that uses any two of these functions: $concat, $substr, $toLower, $toUpper 2. Describe a scenario and write a query that uses any two of these functions: $add, $divide, $mod, $multiply, $subtract 3. Describe a scenario and write a query that uses $redact, $$descend and $$prune command
1. What is the NoSQL movement?
1. What is the NoSQL movement?
what is the extended definition of MongoDB, Cassandra, influxdb, and neo4j?
what is the extended definition of MongoDB, Cassandra, influxdb, and neo4j?
Donald Trump railed against NFL players who protested at Thursday night's preseason games, saying the players...
Donald Trump railed against NFL players who protested at Thursday night's preseason games, saying the players are outraged about "something that most of them are unable to define." "The NFL players are at it again - taking a knee when they should be standing proudly for the National Anthem. Numerous players, from different teams, wanted to show their 'outrage' at something that most of them are unable to define. They make a fortune doing what they love," he tweeted from...
In repeated games, players do not have the opportunity to build a reputation and to discover...
In repeated games, players do not have the opportunity to build a reputation and to discover more about the opponent. True False
What is behaviour? Give examples of overt and covert behaviour.
What is behaviour? Give examples of overt and covert behaviour.
5. Consider the following games played between two players, A and B.   Game 1: A and...
5. Consider the following games played between two players, A and B.   Game 1: A and B have reached a verbal agreement: A would deliver a case of beer to B, and B would deliver a bag of beer nuts to A. Now, each player needs to take an action: keep the promise (to deliver the goods), break the promise. If both keep their promises, then each player gets a payoff of 5; if both break their promises, then each...
Two towns had a population of 12,000 in 1990. By 2000, the population of town A...
Two towns had a population of 12,000 in 1990. By 2000, the population of town A had increased by  13⁢ % while the population of town B had decreased by  13⁢ %. Assume these growth and decay rates continued. a. Write two exponential population models A(T) and B(T) for towns A and B, respectively, where T is the number of decades since 1990. A(T)= 12000*e0.12*T B(T)= 12000*e−0.14*T b. Write two new exponential models a(t) and b(t) for towns A and...
What is a covert channel and how is it useful to conceal pentest activity?
What is a covert channel and how is it useful to conceal pentest activity?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT