Concept Flow - INSERT with specific columns
Start
Specify Table
Specify Columns
Provide Values
Execute Insert
Row Added to Table
End
This flow shows how to insert data into specific columns of a table step-by-step.
INSERT INTO employees (id, name) VALUES (1, 'Alice');
| Step | Action | Table State Before | Columns Specified | Values Provided | Table State After |
|---|---|---|---|---|---|
| 1 | Start insert command | employees table empty | id, name | (1, 'Alice') | employees table empty |
| 2 | Check columns exist | employees table empty | id, name | (1, 'Alice') | employees table empty |
| 3 | Insert row with specified columns | employees table empty | id, name | (1, 'Alice') | employees table has 1 row: {id:1, name:'Alice', other columns NULL} |
| 4 | End insert command | employees table has 1 row | id, name | (1, 'Alice') | employees table has 1 row: {id:1, name:'Alice', other columns NULL} |
| Variable | Start | After Step 3 | Final |
|---|---|---|---|
| Table rows count | 0 | 1 | 1 |
| Inserted row | N/A | {id:1, name:'Alice', others:NULL} | {id:1, name:'Alice', others:NULL} |
INSERT INTO table_name (column1, column2) VALUES (value1, value2); - Specify only columns you want to insert. - Unspecified columns get NULL or default. - Database checks columns exist before insert. - Helps insert partial data safely.