Skip to content

Commit 9a5c850

Browse files
authored
Merge pull request #23 from eduardpeters/typos
Fix typo in Constraints lesson text
2 parents aebe0d7 + b176cf8 commit 9a5c850

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lessons/04-joins-and-constraints/E-constraints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You actually already know what constraints are and have used them not once but T
66

77
A constraint is just a constraint you put around a column. For example, NOT NULL is a constraint we've used for our primary keys. You always need a primary key.
88

9-
UNIQUE is another constraint that dictates that this column must be unqiue amongst all other columns. Ever wonder how an app can tell you so quickly if an email or a user name is taken so quickly? They likely use a UNIQUE constraint on those two columns. They should. PRIMARY is another such constraint.
9+
UNIQUE is another constraint that dictates that this column must be unique amongst all other columns. Ever wonder how an app can tell you so quickly if an email or a user name is taken so quickly? They likely use a UNIQUE constraint on those two columns. They should. PRIMARY is another such constraint.
1010

1111
We also added a constraint on recipe_ingredients that every row must have a unique combination of recipe_id and ingredient_id. We could have added an additional primary, incrementing, unique ID but what would we use that for? To me at this moment it doesn't serve a purpose so we can just use the other two as a unique key. This is common for these sorts of many-to-many connecting tables.
1212

0 commit comments

Comments
 (0)