Microsoft Word - CM XXXXXXXXXXCoursework.docx 1 CardiffSchoolofComputerScienceandInformatics CourseworkAssessmentforCM3104LargeScaleDatabases ModuleCode:CM3104 ModuleTitle:...

1 answer below »
please follow instructions in the pdf


Microsoft Word - CM3104-2018-Coursework.docx 1 CardiffSchoolofComputerScienceandInformatics CourseworkAssessmentforCM3104LargeScaleDatabases ModuleCode:CM3104 ModuleTitle:LargeScaleDatabases Lecturer:C.B.Jones,A.I.Abdelmoty,J.Shao AssessmentTitle:Coursework1 AssessmentNumber:1 DateSet:Thursday1stNovember2018 SubmissionDateandTime:Wednesday5thDecember2018at9:30am. ReturnDate:Week12,Friday11thJanuary2019. Thisassignmentisworth30%ofthetotalmarksavailableforthismodule.Thepenaltyfor lateornon-submissionisanawardofzeromarks. YoursubmissionmustincludetheofficialCourseworkSubmissionCoversheet,whichcanbe foundhere: https://docs.cs.cf.ac.uk/downloads/coursework/Coversheet.pdf SubmissionInstructions Description Type Name Cover sheet Compulsory One PDF (.pdf) file [student number].pdf PART A Compulsory One PDF (.pdf) file comprising your answer to all questions with snapshots of the mongodb shell as explained below. PartA_[student number].pdf Compulsory The javascript file with your answer to all the questions in Task 2. PartA_[student number].js PART B Compulsory One PDF (.pdf) file that contains answers to all questions. PartB_[student number].pdf PART C Compulsory One PDF (.pdf) file that includes for each of the five answers to Part C: 1 - The Oracle SQL query; 2 – The answer to the query; 3 - A screen shot of: the query in Oracle followed by the Oracle output from the query. PartC_[student number].pdf Anydeviationfromthesubmissioninstructionsabove(includingthenumberandtypesof filessubmitted)mayresultinamarkofzerofortheassessmentorquestionpart. 2 CourseworkPARTA:NoSQLDatabases[worth10marks] Inthispartofthecourseworkyouwillmakeuseoftwodatasets:arestaurantsdataset(in thefile,restaurants.js)andazipcodesdataset(inthefilezipcodes.js).Youarebuildingan applicationwithMongoDBthatwillusebothdatasetstofindinformationaboutrestaurants indifferentcities. Anexamplerecordfromtherestaurantsdatasetis: { "_id":ObjectId("55cba2476c522cafdb053ae8"), "location":{ "coordinates":[ -73.9973325, 40.61174889999999 ], "type":"Point" }, "name":"C&CCateringService" } Anexamplerecordfromthezipcodesdatasetis: { "_id":"01002", "city":"CUSHMAN", "loc":[ -72.51565, 42.377017 ], "pop":36963, "state":"MA" } Hereisamapofasamplefromtherestaurantsdataset. 3 Task1 ImportbothdatasetsintoMongoDBinONEdatabase.Eachdatasetshouldbestoredina separatecollection.Forexample,youcouldbuilda“services”databasewithtwo collections:“restaurants”and“zipcodes”. (1mark) Task2 1. FindallthePizzarestaurantsinthedatasetandcounttheirnumber. APizzarestaurantisanyrestaurantwhichhastheword“Pizza”initstitle. (1mark) 2. ForeachPizzarestaurantfromtheaboveset,findthecitythatitislocatedin. Youcanassumethatarestaurantislocatedinthenearestcitytoitslocation. (2marks) 3. Inyourapplicationyouwillneedtoretrievetherestaurantsandtheirassociated citiesfrequently. Createanewcollection(“geodb”)thatcontainsallthedataintherestaurant collection,butforeveryrestaurantdocumentinthenewcollection,addan additionalfield“city”whosevalueistheclosestcitytotherestaurant’slocation.Use thesamemethodoffindingthecityasyouhavedoneinquestion2. Documentsinyournew“geodb”collectionshouldbesimilartothefollowing: { "_id":ObjectId("55cba2476c522cafdb053ae8"), "location":{ "coordinates":[ -73.9973325, 40.61174889999999 ], "type":"Point" }, "name":"C&CCateringService", "city":"BROOKLYN" } (3marks) 4 4. Querythenew“geodb”collectiontofindrestaurants,groupedbycity.Youranswer shouldinclude:cityname,numberofrestaurantsinthecityandalistofallthe namesoftherestaurantsinthecity. Anexampledocumentoftheresultsofthisqueryisasfollows: { "City":"MOBILE", "NoofRestaurants":3, "Restaurants":[ "IslandSoftPretzelStop", "DairyQueenGrill&Chill", "StatueOfLibertyDeli" ] } (2marks) 5. Adifferentmethodofstoringtherestaurantandcityinformationtogetherisby modifyingtheoriginal“zipcodes”collectionbyaddingafield“restaurantsInCity” whosevalueisanarrayofalltherestaurantsthatarelocatedinthecity.An exampleofadocumentinthemodified“zipcodes”collectionisasfollows: { "_id":"36607", "city":"MOBILE", "loc":[ -88.1029, 30.697486 ], "pop":8610, "state":"AL" “restaurantsInCity”:[“IslandSoftPretzelStop”,“DairyQueenGrill&Chill”,"Statue OfLibertyDeli"] } ExplainwhetherthisisasensiblemodellingoptioninMongoDB,byreferringtoits effectivenessforstoringandretrievingtheinformationaboutrestaurantsand associatedcities. (1mark) 5 UPLOADSFORPARTA 1. SaveyouranswertothequestionsinTask2inajavascriptfilewiththename: PartA_[studentnumber].js 2. SaveyouranswertoallquestionsinTask1andTask2inapdffile: PartA_[studentnumber].pdf.Youcantakeasnapshotofthequestionbeing executedintheMongoDBshell,clearlydemonstratingtheanswertothequestion (includesnapshotsofallintermediatestepsasappropriate).Asampleoftheresults issufficient–thisshouldbethefirst5documents.Anexampleofasufficient snapshotoftheanswertoaquerytofindallrecordsinthe“zipcodes”collectionisas follows.
Answered Same DayNov 26, 2020

Answer To: Microsoft Word - CM XXXXXXXXXXCoursework.docx 1 CardiffSchoolofComputerScienceandInformatics...

Aakarsh answered on Dec 01 2020
151 Votes
Coursework PART A: NoSQL Databases
In this part of the two data sets are provided: a restaurants d
ata set (in the file,
restaurants.js) and a zipcodes data set (in the file zipcodes.js). An application with MongoDB
is created that will use both data sets to find information about restaurants in different
cities.
Task1
Import both datasets into MongoDB in ONE database. Each dataset should be stored in a
separate collection. For example, you could build a “services” database with two
collections: “restaurants” and “zipcodes”.
Restaurant Data after importing into MongoDB
Zipcodes data after importing in MongoDB
Task2
1. Find all the Pizza restaurants in the dataset and count their number.
A Pizza restaurant is any restaurant which has the word “Pizza” in its title.
Query: dbo.collection('restaurants').find({name:/Pizza/}).count()
Output: 1260
2. For each...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here