Skip to main contentSkip to solution

Identify the correct order while working on databases:

(A) Activate database

(B) Insert records

(C) Create a table with constraints

(D) Create a database

Solution

✅ Correct Option: 1

(D) Create a database: CREATE DATABASE db_name;

(A) Activate database: USE db_name; so that later commands apply to it

(C) Create a table with constraints: CREATE TABLE ... with keys such as PRIMARY KEY and NOT NULL

(B) Insert records: INSERT INTO ... VALUES ...; which works only after the table exists


Options 2 and 3: a database cannot be activated before it is created, so (A) cannot come before (D).

Option 4: records cannot be inserted before the table exists, so (B) cannot come before (C).

Keyboard Shortcuts

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