We're going to start with a Create Table statement and Create Directors table, some movie directors for us. Nice ID column here. Serial says that it's going to be auto-incrementing, so it would go one, two, three automatically. We don't have to worry about that.
We'll get a name for our directors. This is going to be a string up to 200 characters long. We can just see here that the directors table is in fact created. There's no data in it. Name, ID -- that's what we expect to see.
Directors don't really matter unless we have movies. Let's give it another ID column. We've seen that before. Again, these are kind of arbitrary. We'll give it a title. We probably want the title to be there, so we're going to say that it's not null. It can never be null.
Let's give it a release date. We haven't seen the date definition before. It's going to be the number of stars they can have, maybe one, two, three, four, five. Let's give it a director ID to reference the directors table.
We saw directors before. Let's see movies. There we go. A little empty table. That's what we expect.
Just for good measure, I'm going to insert some data here. Don't worry about what these things say. I just want to take a look at what this means to have some data in our tables now, so we can have a sense of what these tables are about.
Now we have our directors table up here. We see IDs were inserted for us, because we only inserted some names up here. The same thing happens for us down here in the movies table. We inserted a couple movies, and this is what those tables look like when we fill in some more data.