# INSERT — MySQL

Source: https://www.geekswithgeeks.com/en/mysql/sql-insert

> Add new rows into a table.

## Inserting one row

List the columns, then matching values in the same order.

```sql
INSERT INTO customers (name, email)
VALUES ('Asha Rao', 'asha@example.com');
```

Output:

```
Query OK, 1 row affected
```

## Inserting multiple rows

One `INSERT` statement can add several rows at once — faster than one statement per row.

```sql
INSERT INTO customers (name, email) VALUES
  ('Rahul Mehta', 'rahul@example.com'),
  ('Priya Nair', 'priya@example.com');
```

Output:

```
Query OK, 2 rows affected
```

**Quiz:** Why insert multiple rows in a single statement?

- [ ] It's the only way MySQL allows inserts
- [x] It's generally faster than one INSERT per row
- [ ] It skips the NOT NULL constraints

*Answer:* It's generally faster than one INSERT per row. Batching reduces round trips to the server.
