Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For part 2 of this project you will use the mongoDB classicmodels database you just loaded to answer the following questions . List the names

For part 2 of this project you will use the mongoDB classicmodels database you just loaded to answer the following questions.

List the names and credit limit of the customers with the 10 lowest credit limits { "customerName" : "Precious Collectables", "creditLimit" : 0 } { "customerName" : "American Souvenirs Inc", "creditLimit" : 0 } { "customerName" : "Boards & Toys Co.", "creditLimit" : 11000 } { "customerName" : "Atelier graphique", "creditLimit" : 21000 } { "customerName" : "Auto-Moto Classics Inc.", "creditLimit" : 23000 } { "customerName" : "Royale Belge", "creditLimit" : 23500 } { "customerName" : "Frau da Collezione", "creditLimit" : 34800 } { "customerName" : "Microscale Inc.", "creditLimit" : 39800 } { "customerName" : "Gifts4AllAges.com", "creditLimit" : 41900 } { "customerName" : "Tekni Collectables Inc.", "creditLimit" : 43000 }

Write a query to calculate the number of products each product vendor supplies in the database. Display the result in a field called numberOfProducts". is descending order by number of Products. { "_id" : "Classic Metal Creations", "numberOfProducts" : 10 } { "_id" : "Exoto Designs", "numberOfProducts" : 9 } { "_id" : "Carousel DieCast Legends", "numberOfProducts" : 9 } { "_id" : "Gearbox Collectibles", "numberOfProducts" : 9 } { "_id" : "Highway 66 Mini Classics", "numberOfProducts" : 9 } { "_id" : "Motor City Art Classics", "numberOfProducts" : 9 } { "_id" : "Unimax Art Galleries", "numberOfProducts" : 8 } { "_id" : "Second Gear Diecast", "numberOfProducts" : 8 } { "_id" : "Studio M Art Models", "numberOfProducts" : 8 } { "_id" : "Welly Diecast Productions", "numberOfProducts" : 8 } { "_id" : "Autoart Studio Design", "numberOfProducts" : 8 } { "_id" : "Min Lin Diecast", "numberOfProducts" : 8 } { "_id" : "Red Start Diecast", "numberOfProducts" : 7 }

Calculate the dollar value of each product in inventory. You can calculate this by multiplying the quantity in stock by the buy price. Display the product name, quantity in stock, buy price, and in its dollar value in a column called Dollar Value. Sort the results in descending order based on dollar value. The results show the first 5 and last 5 results.

{ "productName" : "1995 Honda Civic", "quantityInStock" : 9772, "buyPrice" : 93.89, "DollarValue" : 917493.08 } { "productName" : "1952 Alpine Renault 1300", "quantityInStock" : 7305, "buyPrice" : 98.58, "DollarValue" : 720126.9 } { "productName" : "1962 LanciaA Delta 16V", "quantityInStock" : 6791, "buyPrice" : 103.42, "DollarValue" : 702325.22 } { "productName" : "1968 Dodge Charger", "quantityInStock" : 9123, "buyPrice" : 75.16, "DollarValue" : 685684.6799999999 } { "productName" : "1976 Ford Gran Torino", "quantityInStock" : 9127, "buyPrice" : 73.49, "DollarValue" : 670743.23 } ... { "productName" : "Pont Yacht", "quantityInStock" : 414, "buyPrice" : 33.3, "DollarValue" : 13786.199999999999 } { "productName" : "1997 BMW F650 ST", "quantityInStock" : 178, "buyPrice" : 66.92, "DollarValue" : 11911.76 } { "productName" : "1968 Ford Mustang", "quantityInStock" : 68, "buyPrice" : 95.34, "DollarValue" : 6483.12 } { "productName" : "1928 Ford Phaeton Deluxe", "quantityInStock" : 136, "buyPrice" : 33.02, "DollarValue" : 4490.72 } { "productName" : "1960 BSA Gold Star DBD34", "quantityInStock" : 15, "buyPrice" : 37.32, "DollarValue" : 559.8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago