SQL Server Questions and Answers – Data Definition Language – 1

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Data Definition Language – 1”.

1. What options did ALTER DATABASE statement add?
a) DATABASE SNAPSHOT syntax
b) ATTACH_REBUILD_LOG clause
c) DB_CHAINING option
d) READ_COMMITTED_SNAPSHOT
View Answer

Answer: d
Explanation: ALTER DATABASE is used for instant file initialization when adding or growing data files.

2. Which of the following item is provided by CREATE DATABASE statement?
a) Service Broker options
b) ALLOW_SNAPSHOT_ISOLATION
c) DB_CHAINING
d) Database mirroring
View Answer

Answer: a
Explanation: CREATE DATABASE is used mainly for creating new database.

3. Which of the following statement removes database including its related components?
a) DROP DATABASE
b) DELETE DATABASE
c) REMOVE DATABASE
d) None of the mentioned
View Answer

Answer: a
Explanation: DROP statement adds support for dropping database snapshots.

4. Which of the following database cannot be dropped?
a) TEMPDB
b) Master
c) MSDB
d) All of the mentioned
View Answer

Answer: d
Explanation: System databases cannot be dropped.

advertisement
advertisement

5. Point out the correct statement.
a) When a database is dropped, the master database should be backed up
b) You can drop a database currently being used
c) Dropping a database snapshot does not delete the database snapshot from an instance of SQL Server
d) None of the mentioned
View Answer

Answer: a
Explanation: Master database records all of the system level information for a SQL Server.

6. Which is the minimal permission that a user must have to drop the database?
a) READ
b) WRITE
c) VIEW
d) CONTROL
View Answer

Answer: d
Explanation: To execute DROP DATABASE, at a minimum, a user must have CONTROL permission on the database.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

7. Which of the following statement removes sales and suppliers database?
a) DROP DATABASE Sales, NewSales
b) DROP DATABASE Sales, suppliers
c) DROP DATABASE Sales and suppliers
d) DROP DATABASE Sales-suppliers
View Answer

Answer: b
Explanation: DROP DATABASE can be used for removing multiple databases in one statement.

8. Which of the following statement is used to create database snapshot?
a) CREATE DATABASE
b) CREATE SNAPSHOT
c) CREATE SNAPDB
d) None of the mentioned
View Answer

Answer: a
Explanation: CREATE DATABASE statement creates a new database and the files used to store the database, creates a database snapshot, or attaches a database from the detached files of a previously created database.

advertisement

9. Syntax for dropping a database snapshot named “Sushant” would be ____________
a) DROP DATABASE Sushant
b) DROP DATABASE SNAP Sushant
c) DROP SNAPSHOT Sushant
d) None of the mentioned
View Answer

Answer: a
Explanation: DROP command removes database snapshot without affecting the source database.

10. View used used for displaying current status of database is ___________
a) system.databases
b) current.databases
c) sys.databases
d) status.databases
View Answer

Answer: c
Explanation: sys.databases catalog view is used for displaying the present status of the system.

advertisement

Sanfoundry Global Education & Learning Series – SQL Server.

To practice all areas of SQL Server, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.