What if you could copy thousands of records with one simple command instead of typing each one?
Why INSERT with SELECT in MySQL? - Purpose & Use Cases
Imagine you have two big lists of contacts in separate spreadsheets. You want to add all contacts from one list into the other without typing each one manually.
Copying and pasting each contact one by one is slow and mistakes happen easily. You might miss some entries or add duplicates by accident.
Using INSERT with SELECT lets you copy many rows from one table to another in one simple command, saving time and avoiding errors.
INSERT INTO contacts (name, email) VALUES ('Alice', 'alice@example.com'); INSERT INTO contacts (name, email) VALUES ('Bob', 'bob@example.com');
INSERT INTO contacts (name, email) SELECT name, email FROM new_contacts;
This lets you quickly merge data from one table into another, making database updates fast and reliable.
A company merges customer info from a marketing list into their main customer database without retyping or errors.
Manual entry is slow and error-prone.
INSERT with SELECT copies many rows at once.
It makes data merging easy and safe.