Home »
SQL »
SQL MCQs
SQL Database-related Commands MCQs
SQL Database MCQ: This section contains the Multiple-Choice Questions & Answers on SQL Database.
Submitted by Anushree Goswami, on August 25, 2021
SQL Database-related Commands MCQs
1. SQL CREATE DATABASE is used to,
- Create a table
- Create a database
- Create a column
- Create a row
Answer: B) Create a database
Explanation:
SQL CREATE DATABASE is used to create a database.
Discuss this Question
2. A database does not need to be created in ____. A direct table creation option is provided in ____.
- MySQL
- Oracle
- Both A and B
- None of the above
Answer: C) Both A and B
Explanation:
A database does not need to be created in Oracle. A direct table creation option is provided in Oracle.
Discuss this Question
3. SQL ___ can be used to delete or drop existing databases in a SQL schema.
- CREATE DATABASE
- RENAME DATABASE
- DROP DATABASE
- SELECT DATABASE
Answer: C) DROP DATABASE
Explanation:
SQL DROP DATABASE can be used to delete or drop existing databases in a SQL schema.
Discuss this Question
4. Using the ___ statement, a database can be renamed.
- SQL CREATE DATABASE
- SQL RENAME DATABASE
- SQL DROP DATABASE
- SQL SELECT DATABASE
Answer: B) SQL RENAME DATABASE
Explanation:
Using the SQL RENAME DATABASE statement; a database can be renamed.
Discuss this Question
5. Which of the following statement is TRUE?
- A DATABASE name can be renamed.
- A TABLE name can be renamed.
- Both A and B
- None of the above
Answer: C) Both A and B
Explanation:
Both DATABASE and TABLE name can be renamed.
Discuss this Question
6. Which syntax is correct for RENAME DATABASE in MySQL?
- RENAME old_database_name TO new_database_name;
- RENAME DATABASE old_database_name TO new_database_name;
- ALTER old_database_name MODIFY NAME = new_database_name;
- ALTER DATABASE old_database_name MODIFY NAME = new_database_name;
Answer: B) RENAME DATABASE old_database_name TO new_database_name;
Explanation:
RENAME DATABASE old_database_name TO new_database_name; syntax is used to Rename Database in MySQL.
Discuss this Question
7. Which syntax is correct for RENAME DATABASE in SQL?
- RENAME old_database_name TO new_database_name;
- RENAME DATABASE old_database_name TO new_database_name;
- ALTER old_database_name MODIFY NAME = new_database_name;
- ALTER DATABASE old_database_name MODIFY NAME = new_database_name;
Answer: D) ALTER DATABASE old_database_name MODIFY NAME = new_database_name;
Explanation:
ALTER DATABASE old_database_name MODIFY NAME = new_database_name; syntax is used to Rename Database in SQL.
Discuss this Question
8. Which statement is used to select the database in SQL?
- SELECT
- USE
- ALTER
- CREATE
Answer: B) USE
Explanation:
USE statement is used to select the database in SQL.
Discuss this Question
9. Which statement is used to select the database in Oracle?
- USE
- SELECT
- RENAME
- None of the above
Answer: D) None of the above
Explanation:
In Oracle, the database does not need to be selected.
Discuss this Question
10. Which syntax is used to show all the databases?
- USE DATABASES;
- SELECT DATABASES;
- SHOW DATABASES;
- None of the above
Answer: C) SHOW DATABASES;
Explanation:
SHOW DATABASES; syntax is used to show all the databases.
Discuss this Question