Effective PyCharm Transcripts
Chapter: Databases
Lecture: Database diagrams

Login or purchase this course to watch this video and the rest of the course contents.
0:01 There are a lot of things we could focus on first as we start to explore the data— querying it, modifying it and so on.
0:07 But let's start by trying to understand the data and a picture is really often worth a thousand words or something like that,
0:16 so you'll see that we can actually do some pretty cool things. I could come over here and right click on track and say show me a diagram,
0:25 or I could do better, I could actually click on a group of schemas or the whole database and say show me the diagram,
0:32 and I get two options, one is a straight up visualization, another is what's called a visualization pop up
0:37 let's do the straight normal visualization first. Look at this, how awesome is that? So I told you that is this foreign key from album id over to id
0:47 and look, there it is, visually. We got SQLite in this master here, we don't really need that,
0:53 I'll take that off of our diagram we put these up next to each other, it's kind of funky the way that maps over,
1:00 but nonetheless, we can see this relationship and it's not a huge deal in this kind of simple little thing
1:05 but if this was really complicated, this would be very helpful for us understanding how things relate,
1:11 what the relationships are that we can navigate and things like that. It actually helps a lot that we have SQLAlchemy
1:17 because we can come over here and look at this as well and it will tell us a little bit about— well, it will tell us a lot
1:22 but you know, only one table at a time, it will tell us a lot about what's in here, but even so, seeing the big picture is really, really nice
1:31 and so these diagrams I think they're great. Now, this is the sort of tabbed version, so sometimes you don't want to necessarily open up another tab
1:39 and have a little file, so you can just do like a quick little peak if you will with this pop up,
1:44 and here we have just this little quick pop up to remind you what the relationship of these things are. It's kind of hard to wrap your mind around it
1:52 like if this was actually complicated there might be 50 tables you have to imagine this is complicated,
1:57 but you saw when we did show us all these, this little pop up we got everything, including the little master maybe we want to just focus our attention
2:07 on the relationships between just a few classes right, again, this is so simple, it didn't really matter
2:12 but if you had many, you could focus on three or four tables which seems pretty reasonable, highlight them and say show us the diagram,
2:19 and now only those tables are included in the diagram. This is really sweet, I love this feature
2:24 it's really nice for both documenting and sharing the schema that you're using your data models with other developers
2:30 and maybe in some form of documentation.


Talk Python's Mastodon Michael Kennedy's Mastodon