Skip to main contentSkip to solution

Sequence the order for a SQL query:

(A) Create a Database

(B) Create the Table

(C) Write the Query

(D) Open the Database

Solution

✅ Correct Option: 1

A table is stored inside a database, so the database must be created and opened before a table can be made. A query can be written only after the table exists.

(A) Create a Database

(D) Open the Database

(B) Create the Table

(C) Write the Query


Option 2: the table is created before the database is opened, so there is no database selected to hold it (for example, no USE statement in MySQL).

Option 3: the table is created before any database exists.

Keyboard Shortcuts

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