Skip to main contentSkip to solution

To create a database, which SQL statement is used?

Solution

✅ Correct Option: 2

CREATE DATABASE is the SQL statement that creates a new database, for example CREATE DATABASE school;\texttt{CREATE DATABASE school;}


Option 1: CREATE TABLE creates a table inside an existing database, not the database itself.

Option 3: SHOW DATABASES only lists the databases that already exist; it creates nothing.

Create the database first, select it with USE, and only then create tables in it.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question