Sale!

ECE:5995 Homework 4 Document stores –MongoDB solution

$30.00 $25.50

Category:

Description

5/5 - (7 votes)

Modern Databases
For this homework we will use the zips and the city_inspections collections we imported during class.
City inspections is in ICON and the zip code dataset is available at media.mongodb.org/zips.json
1. Write mongodb queries to answer the following questions using the zips collection (submit both the
query and answer).
Q1: The number of zipcodes in the state of New York
Q2: The number of cities in the state of New York.
Q3. List the cities in the state of New York with more than 10 zip codes in alphabetical order. The
result should include the name of the city, the state, and the number of zip codes.
Q4: List the cities in the state of New York with over 100K people in descending order of population.
Q5: For the ten most popular cities in NY (the ones with the most population), get the minimum and
maximum latitude and longitude.
2. Write mongodb queries to answer the following questions using the city_inspections collection
(submit both the query and answer).
Q6. Count the number of inspections performed in the cities of Brooklyn, New York, or Bronx.
Q7. List the cities with inspections containing the keyword “bro” (case insensitive).
Q8. List the businessesthat contain the keywords (case insensitive): “gourmet”, “food”, “corp” in the
business name and whose inspection resulted in an issued violation.
Q9. Count the number of inspections per result performed in Feb 2015.
Q10. Which is the city with the most inspections in 2015?
3. Consider the need to identify the employee that performed the inspection. Employees have an
employee number, first name, last name, address, phone number(s), preferred schedule (day and
time for the week), and license plate. What changes/additions would you make to the database to
store this information? Provide the rationale and implications (strengths and weaknesses) of your
approach.
Submission:
Submit your homework as a single file to the dropbox for Homework 4 in ICON by Tuesday October 20th
11:59pm.