The models that database designers create are called Entity Relationship Diagrams, because they are intended to model the way tables will eventually relate to each other in the finished database.
In our video on modeling table relationships, we saw some examples of simple Crow’s Foot notation. There are actually many combinations of cardinality symbols used in Crow’s Foot models.
Also, as with many things in technology and the rest of the world, there are more than one way to do things. There are other types of relationship notation that we didn’t get into.
Here are a few:
So far we've learned about the three types of relationships. 0:00 One to many, many to many, and one to one. 0:03 Now we'll see how these relationships are depicted during the design process. 0:06 When a database architect is designing a database, 0:11 they use special software to model relationships between tables. 0:14 There are entire books on this topic of database modeling. 0:18 So we'll just keep it simple. 0:21 During the design process, the model speaks about tables as entities. 0:24 Entities eventually become tables in the physical database. 0:29 But during the design, we speak about them take conceptual level. 0:33 They models that database designers create are called entity relationship diagrams. 0:38 Because they're intended to model the way database tables will 0:43 eventually relate to each other in the finished database. 0:46 Let's take a closer look at how database design is depict relationships 0:51 in their modeling tools. 0:55 Here we see two entities, product category and product. 0:57 One product category can contain many products. 1:02 But a product can only belong to one part of category. 1:05 Therefore this is a one to many relationship. 1:08 Database designers use a special notation to 1:12 indicate the relationship between tables. 1:14 One of the most common notation styles is called crow's foot notation. 1:17 To show the one to many relationship in this notation style, we make a little 1:21 symbol that looks like a bird's foot on the side where the foreign key will go. 1:26 This is the many side of the relationship. 1:31 This is why it's called crow's foot notation. 1:33 Then on the primary key side of the relationship, 1:36 we make a little line indicating the one side. 1:39 This is what a one to one relationship looks like, 1:42 with small line indicators on both sides. 1:45 This is what a many to many relationship looks like, 1:49 with crow's feet indicates on both sides. 1:53 Of course, as we learned in the video on many to many relationships, 1:55 tables can't support this relationship. 1:59 So even though it makes sense conceptually, 2:02 we have to resolve this in our design. 2:04 We do this by introducing a third table 2:07 with the foreign keys to the two outside tables. 2:10 One must note about entity relationship diagrams. 2:13 Crow's feet is not the only style of relationship notation that database 2:16 designers use. 2:21 Check out the teacher's notes for more information on this style and others. 2:22
You need to sign up for Treehouse in order to download course files.Sign up