SQL Data Manipulation
Last updated
Was this helpful?
Last updated
Was this helpful?
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 section.
In conjunction with these commands, PostgreSQL also provides powerful functions for s, such as concatenation, trimming, and substring extraction, as well as a comprehensive suite of 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.
In the following subsections, we will be using film,
customer
, payment
and rental
tables from the dvdrental
database (formally known as ) which can be accessed via: .
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 .