Identify the correct order while working on databases:
(A) Activate database
(B) Insert records
(C) Create a table with constraints
(D) Create a database
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).
Related questions:
2025: 15 May Shift 2
2026: 26 May Shift 1