---
title: "SQL Queries: Insert, Update, Delete, and Merge"
description: "You can modify Table data with thse SQL queries. Those are Insert, Update, Delete and Merge."
url: https://srinimf.com/2021/08/14/here-are-4-sql-queries-useful-to-alter-table-data/
date: 2021-08-14
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2021/08/pexels-photo-4022332.jpeg?fit=1880%2C1253&ssl=1
categories: ["SQL"]
tags: ["Delete", "insert", "merge", "Update"]
type: post
lang: en
---

# SQL Queries: Insert, Update, Delete, and Merge

With SQL queries like INSERT, UPDATE, DELETE, and Merge, you can easily modify data in a Table.

## Top SQLQeries

**INSERT Query**

```
insert /*+ append */ into kso.big_emp
select *
from hr.employees;

insert /*+ append_values */ into dual (dummy)
values (‘Y’);
```

[How to use](https://srinimf.com/2022/02/14/merge-sql-query-these-are-useful-points-to-know/) both [append and append-values.](https://oracle-base.com/articles/misc/append-hint)

**UPDATE SQL Query**

```
update skew2
set col1 = col1*1;
```

This query will do a mass update. Instead, use INSERT with “APPEND”. Hint to improve performance.

**DELETE SQL Query**

```
delete from kso.skew2 
where col1=1;
```

This is also called mass deletion. If the rows are more, it takes more CPU time. If we want to delete all the rows, [always use TRUNCATE.](https://www.techonthenet.com/oracle/truncate.php)

**MERGE SQL Query**

It is introduced with 9i. The basic functionality is when matches, it will update. When not match it will insert.

```
MERGE INTO table_name
USING (subquery) ON (subquery.column = table.column)
WHEN MATCHED THEN UPDATE
WHEN NOT MATCHED THEN INSERT
```

Merge has its internal mechanism, it takes more CPU time. So always use an insert with “APPEND” to delete bulk rows. [Here’s to read more on Merge SQL query.](https://docs.oracle.com/database/121/SQLRF/statements_9017.htm#SQLRF01606)

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2021%2F08%2F14%2Fhere-are-4-sql-queries-useful-to-alter-table-data%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2021%2F08%2Fpexels-photo-4022332.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=SQL%20Queries%3A%20Insert%2C%20Update%2C%20Delete%2C%20and%20Merge)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2021/08/14/here-are-4-sql-queries-useful-to-alter-table-data/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2021/08/14/here-are-4-sql-queries-useful-to-alter-table-data/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2021/08/14/here-are-4-sql-queries-useful-to-alter-table-data/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2021/08/14/here-are-4-sql-queries-useful-to-alter-table-data/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20SQL%20Queries%3A%20Insert%2C%20Update%2C%20Delete%2C%20and%20Merge&body=https%3A%2F%2Fsrinimf.com%2F2021%2F08%2F14%2Fhere-are-4-sql-queries-useful-to-alter-table-data%2F&share=email)
-

### Like this:

Like Loading…
