# SQL Data Manipulation

Data manipulation is a critical aspect of working with databases, and PostgreSQL offers a robust set of commands for managing and interacting with data. Among these, the `INSERT` statement is used to add new records to a table, while the `UPDATE` statement modifies existing data. The `DELETE` statement, on the other hand, is used to remove records from a table. You can check more on these statements/commands in the [Creating and Modifying Tables](https://dshub.gitbook.io/ds-hub/sql/sql-basics/creating-and-modifying-tables-views) section.

In conjunction with these commands, PostgreSQL also provides powerful functions for [string operation](https://dshub.gitbook.io/ds-hub/sql/sql-data-manipulation/string-operations)s, such as concatenation, trimming, and substring extraction, as well as a comprehensive suite of [date and time functions](https://dshub.gitbook.io/ds-hub/sql/sql-data-manipulation/date-time-operations) that assist in calculating intervals, extracting specific date parts, and formatting dates. Mastering these data manipulation techniques is essential for effective data analyses and a must for all who are working with data.

## 1. Dataset

In the following subsections, we will be using `film,` `customer` , `payment` and `rental` tables from the `dvdrental` database (formally known as [Sakila Database](https://github.com/jOOQ/sakila)) which  can be accessed via: <https://www.postgresqltutorial.com/postgresql-getting-started/postgresql-sample-database/>.

If you like to download the database and run the examples (which I highly recommend) in your local postgres server, you can follow the instructions [here](https://www.postgresqltutorial.com/postgresql-getting-started/load-postgresql-sample-database/).

## 2. [String Operations](https://dshub.gitbook.io/ds-hub/sql/sql-data-manipulation/string-operations)

## 3. [Date Operations](https://dshub.gitbook.io/ds-hub/sql/sql-data-manipulation/date-time-operations)

```sql
```
