1. Home
  2. Computer Science MCQs
  3. MySQL
  4. Which of the following commands should be used to create a…

Added 19 Jan 2024

Which of the following commands should be used to create a database named “student”?

  1. CREATE ?I student
  2. CREATE DATABASE student Correct answer
  3. DATABASE /student
  4. DATABSE student

Correct answer

B. CREATE DATABASE student

20 views

MCQSEXAM

Explanation

CREATE DATABASE student creates a new, empty database named student. You then select it with USE student; before creating tables.

Adding IF NOT EXISTS avoids an error when the database is already there. The other options are not valid SQL syntax.

For more solved questions like this one, see Database Management Systems MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More MySQL MCQs

Practise all MySQL MCQs

Similar MCQs