Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

More Books

Students also viewed these Databases questions

Question

1. What are the pros and cons of diversity for an organisation?

Answered: 1 week ago

Question

1. Explain the concept of diversity and equality in the workplace.

Answered: 1 week ago