Wrapping Up: Insert and Update with Upserts

Review what we have learned about inserting and updating with upserts.

We'll cover the following

Upserts are a great option when we have a data loading process, like inserting the contents of a CSV file that we want to be safely repeatable. However, our data source must have at least one column with a unique index. Our genres table is ideal, as we have a unique index on the name column. If our unique column is the primary key, though, upserts may not be the right option—it would be unusual for the key to appear in a CSV file.

Get hands-on with 1400+ tech skills courses.