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,

  1. Create a table
  2. Create a database
  3. Create a column
  4. 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 ____.

  1. MySQL
  2. Oracle
  3. Both A and B
  4. 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.

  1. CREATE DATABASE
  2. RENAME DATABASE
  3. DROP DATABASE
  4. 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.

  1. SQL CREATE DATABASE
  2. SQL RENAME DATABASE
  3. SQL DROP DATABASE
  4. 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?

  1. A DATABASE name can be renamed.
  2. A TABLE name can be renamed.
  3. Both A and B
  4. 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?

  1. RENAME old_database_name TO new_database_name;
  2. RENAME DATABASE old_database_name TO new_database_name;
  3. ALTER old_database_name MODIFY NAME = new_database_name;
  4. 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?

  1. RENAME old_database_name TO new_database_name;
  2. RENAME DATABASE old_database_name TO new_database_name;
  3. ALTER old_database_name MODIFY NAME = new_database_name;
  4. 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?

  1. SELECT
  2. USE
  3. ALTER
  4. 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?

  1. USE
  2. SELECT
  3. RENAME
  4. 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?

  1. USE DATABASES;
  2. SELECT DATABASES;
  3. SHOW DATABASES;
  4. None of the above

Answer: C) SHOW DATABASES;

Explanation:

SHOW DATABASES; syntax is used to show all the databases.

Discuss this Question





Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.