Question: Create following table in Azure Database and MongoDB using appropriate command (4 Marks):- 1. Animals Animal ID Name Species Age Habitat Available 1 Lion Panthera

Create following table in Azure Database and MongoDB using appropriate command (4 Marks):- 1. Animals Animal ID Name Species Age Habitat Available 1 Lion Panthera leo 5 Savannah True 2 Elephant Loxodonta africana 10 Forest False 3 Giraffe Giraffa camelopardalis 7 Grassland True 4 Penguin Spheniscidae 3 Polar True 2. Update the Species of the animal with AnimalID 2 to 'Elephas maximus'. (2) 3. Insert a new animal with AnimalID 5, Name 'Tiger', Species 'Panthera tigris', Age 4, Habitat 'Jungle', and set it as Available. (2) 4. Print the names of all available animals older than 5 years. (2) 5. Print the species of animals that live in the 'Savannah' habitat. (2) [please note: Query will be graded zero if $in is not used for criteria matching.] 6. Delete all rrecords for animals that are not available. (2)

  1. Update the Age of the animal with AnimalID 3 to 8. (2)
  2. Using aggregation, find the average age of animals in each habitat. Include the habitat name and average age in the result. (2)
  3. Count the number of available animals for each species and sort the result in ascending order of the count. (2 Marks)

Once finished take screenshot of all outputs, save the commands in one file and upload for marks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!