# INSERT — MySQL Fundamentals: SQL, Joins and Transactions

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

> Add rows with INSERT INTO, list columns explicitly and insert many rows in one statement.

## 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
- [ ] It skips the NOT NULL constraints
- [ ] It encrypts the inserted data
- [x] It's generally faster than one INSERT per row

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