Categories
SQL

Bringing Uniqueness with a CTE Sequence

Uniqueness is something we like to reinforce within data. Sometimes the uniqueness will mean we reject data, but other times we want to make it unique. Let’s consider an account name or an order reference. We wouldn’t want to simply reject an account or an order, we want to ensure they’re unique. A typical approach […]

Categories
SQL

Data Integrity Foundations with Constraints (Part 2)

Last week we started to at the use of constraints to support with data integrity in our databases. As a refresher on our introduction from last time: Data integrity helps give us assurance that our data is accurate, complete, and free from errors or inconsistencies. Some of this comes from making sure that data is correct […]

Categories
SQL

Data Integrity Foundations with Constraints (Part 1)

Data integrity helps give us assurance that our data is accurate, complete, and free from errors or inconsistencies. Some of this comes from making sure that data is correct before it enters are databases, but there are some tools we have in our databases which can help with this too – Constraints! Before we jump […]