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.

advertisement

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.

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.

advertisement

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.

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.

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn