Question: Translate the following SQL statement to Mongo DB query statements. use animalshelter Insert into dogs (name, age, breed, catFriendly) values (Charlie, 3, corgi, true) Select

Translate the following SQL statement to Mongo DB query statements.

use animalshelter

Insert into dogs (name, age, breed, catFriendly) values (Charlie, 3, corgi, true)

Select * from dogs

Insert into dogs (name, age, breed, catFriendly) values (Wyatt, 14, Golden, true)

Insert into dogs (name, age, breed, catFriendly) values (Tonya, 17, Chihuahua, true)

In one statement

Insert into cats (name, age, breed, dogFriendly) values (Blue Steele, 6, Scottish, false)

Select * from cats

Select * from dogs

Select * from dogs where breed = corgi

Select * from dogs where catFriendly = true

Select * from dogs where age = 99

Select * from dogs where age > 8

Select * from dogs where breed in ('Mutt', Corgi', Chihuahua'

and age < 10

Select * from dogs where catFriendly = true or age <= 2

Update dogs set age = 4 where name = Charlie

Update dogs set age = 5, breed = Lab where name = Charlie

Delete from dogs where isAvailable = true

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!