:loud_sound: :loud_sound: Hackathon Questions :loud_sound: :loud_sound:

  1. A customer with Email : nicoleanderson@hotmail.com has forgotten their username, please help them find it using sample_analytics.customers.

  2. In sample_mflix.movies, what is the runtime of the movie title “The Kid Brother”?

  3. What is the transaction count where account_id is greater than 183500 and less than 184000? Find it using sample_analytics.transactions.

  4. You are tasked to check a random customer satisfaction rating. Using sample_supplies.sales find the satisfaction rating of customer having email : kave@we.com.

  5. In sample_training.posts, how many posts have title as “Bill of Rights” ?

  6. Using sample_training.zips, find the location coordinates of the city CLEVELAND where the population is between 500 and 1000.

  7. In sample_training.trips, sort the trips in decreasing order and tell the first 2 start station names.

  8. You are starting a restaurant in Bronx and want to know the number of different cuisines being served in the area.
    Find it using “sample_restaurants.restaurants”.

  9. Using sample_training.inspections, find the business_name where zip is greater than 11400 and less than 11500 in City “JAMAICA” and certificate_number ending with 9453.

  10. You are going on a trip with a friend and looking for a place to stay. Using sample_airbnb.listingsAndReviews, find the name of the place where the price should be less than 60 and the number of reviews should be greater than 300, should accommodate 2 people only with no security deposit and the room type should be a Private room with minimum nights equal to 2.

3 Likes

Answers:

  1. db.customers.find({“email”: “nicoleanderson@hotmail.com”})
  2. db.movies.find({“title”: “The Kid Brother”})
  1. db.customers.find({email:“nicoleanderson@hotmail.com”})

 username: 'millerrenee',

db.customers.find({email: “nicoleanderson@hotmail.com”})
username: ‘millerrenee’,

db.customers.find({“email” : “nicoleanderson@hotmail.com”},{username:1,_id:0})

  1. db.customers.find({“email”: “nicoleanderson@hotmail.com”})
    Answer = millerrenee

2)db.movies.find({“title”: “The Kid Brother”})
Answer = 82

  1. 1746

username: ‘millerrenee’,
name: ‘Joshua Parker’

1 -username: ‘millerrenee’,
2 -the movie title “The Kid Brother” runtime is 82

1.millerrenee
rrhgcvjbknlj;k’l
lkjhkl./,

  1. db.posts.countDocuments({“title”: “Bill of Rights”})
    Ans: 142
  1. db.restaurants.countDocuments({“borough”: “Bronx”})
    Ans: 2338

db.movies.find({“title” : “The Kid Brother”},{runtime:1,_id:0})

Q3) transaction_count: 94

ques 2 solution runtime: 82

2.db.movies.find({“title” : “The Kid Brother”},{runtime:1,_id:0})

82

  1. db.customers.find({email:“nicoleanderson@hotmail.com”})
    Answer: username: ‘millerrenee’
  2. db.movies.find({“title”: “The Kid Brother”})
    Answer: 82
  3. Answer: 1746
  4. db.posts.countDocuments({“title”: “Bill of Rights”})
    Answer: 142
  5. db.restaurants.countDocuments({“borough”: “Bronx”})
    Answer: 2338

:loud_sound: Hackathon Hints Using Aggregation!

Hey folks, here are some hints to help you in the hackathon:

  1. $match

  2. $match with $project

  3. use $gt and $lt in $match

  4. using $match you can use ”customer.email”

  5. use $match and $count

  6. use $match, $and, $gt and $lt

  7. $sort and $limit

  8. use $match, $group and $count

  9. use $mod to find the last digits

  10. use $and, $project and comparison operators

2 Likes
  1. Millerrenee
  2. 82
  3. 1746
  4. 142
  5. 2338

10

1.millerrenee
2. 82
3.1746
5.122
6.

1)db.customers.find({“email”: “nicoleanderson@hotmail.com”})
ans:millerrenee
2)db.movies.find({“title”: “The Kid Brother”})
ans:82
3)1746
4) 765
5)db.posts.countDocuments({“title”: “Bill of Rights”})
ans : 142
6)853
8)db.restaurants.countDocuments({“borough”: “Bronx”})
ans: 2338