Insert Into Select
INSERT INTO archive_students (roll, name, marks) SELECT roll, name, marks FROM students WHERE marks < 40; copies query results into another table. Column count and types must line up.
This is how you move a subset without typing VALUES. CREATE TABLE archive AS SELECT … also works if the table does not exist (watch indexes).
Trap — INSERT SELECT without WHERE on a huge table — lock and disk spike.
On the example next to this theory — Insert Into Select — iNSERT adds rows. List columns explicitly for clarity.
FROM students
│
▼
WHERE city = 'Pune'
│
▼
SELECT name, marksExam tip
INSERT INTO archive SELECT … FROM students WHERE marks < 40;