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.
1. What is the NoSQL movement?
1. What is the NoSQL movement?
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?
A bowling team consists of five players. Each player bowls three games. Write a program, in...
A bowling team consists of five players. Each player bowls three games. Write a program, in python, that uses a nested loop to enter each player’s name and individual scores (for three games). You will use one variable for the name and only one variable to enter the scores. Do not use score1, score2, and score3. Compute and display the bowler’s name and average score. Also, calculate and display the average team score. YOU MUST USE A NESTED LOOP FOR...
What would be the point of adding the word “covert” to this concept of sustainable competitive...
What would be the point of adding the word “covert” to this concept of sustainable competitive advantage? Identify a company which utilizes a comparative advantage centered on one particular marketing concept within the 4P’s framework. How does that company turn this comparative advantage into competitive advantage in the marketplace? How does this competitive advantage result in extraordinary profit for the organization when compared with its competition?
Suppose that for the past several decades, daily precipitation in Seattle, Washington has had a mean...
Suppose that for the past several decades, daily precipitation in Seattle, Washington has had a mean of 2.4 mm and a standard deviation of 11.4 mm. Researchers suspect that in recent years, the mean amount of daily precipitation has changed, so they plan to obtain data for a random sample of 195 days over the past five years and use this data to conduct a one-sample ?‑test of ?0:?=2.4 mm against ?1:?≠2.4 mm, where ? is the mean daily precipitation...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT