MongoDB MCQ Questions - Database

This section focuses on "Database". These Multiple Choice Questions (MCQs) should be practiced to improve the MongoDB skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.

1. MongoDB ______ is used to create database.

A. create database_name
B. use database_name
C. insert database_name
D. show database_name

View Answer


2. use database_name command will create a new database if it doesn't exist, otherwise it will return the existing database.

A. Yes
B. No
C. Can be yes or no
D. Can not say

View Answer


3. In MongoDB default database is ________.

A. local
B. mydb
C. test
D. temp

View Answer


4. If you didn't create any database, then collections will be stored in _______ database.

A. local
B. mydb
C. temp
D. test

View Answer


5. MongoDB ___________ command is used to drop a existing database.

A. db.drop()
B. db.dropDatabase()
C. db.deleteDatabase()
D. db.delete()

View Answer


6. If you have not selected any database, then it will delete _________ database.

A. local
B. mydb
C. temp
D. test

View Answer


7. Does we need to use "use database_name" before dropping database?

A. Yes
B. No
C. Can be yes or no
D. Can not say

View Answer


8. How many database present after mondb installation?

A. 1
B. 2
C. 3
D. 4

View Answer


9. What will be mongodb output when we use "use mydb" command?

A. created db mydb
B. new db mydb
C. switched to db mydb
D. None of the above

View Answer


10. If you created database (mydb) is not present in list. To display database, you need to insert at least one document into it.

A. Yes
B. No
C. Can be yes or no
D. Can not say

View Answer





Discussion



* You must be logged in to add comment.