[SOLVED] CIND119-Assignment 3 Querying a NoSQL database using MongoDB

20.99 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

Complete this assignment using MongoDB.

  1. Create a database called “sample”.
  • Create a collection called “test_data” and load the following data into the collection.
class age menopause deg_malig breast breast_quad irradiat
NO 35 premeno 3 left left_low no
NO 42 premeno 2 right right_up no
NO 30 premeno 2 left left_low no
NO 61 ge40 2 right left_up no
NO 45 premeno 2 right right_low no
NO 64 ge40 2 left left_low no
NO 52 premeno 2 left left_low no
NO 67 ge40 1 left left_low no
YES 41 premeno 2 left left_low no
YES 43 premeno 2 right left_up no
YES 41 premeno 3 left central no
YES 44 ge40 2 left left_low no

1 of 2

 

YES 61 lt40 1 left right_up no
YES 55 ge40 3 left right_up no
YES 44 premeno 3 left left_up no

 

  1. Write MongoDB queries to select/compute data from the “test_data” collection.
    1. Select all rows where the menopause column has the value “ge40”.
    2. Select all rows where age is less than 41.
    3. Select all rows where age is less than 41 or the menopause column has the value “ge40”.
    4. Compute the average age across all rows.

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.