All right.
So if all you care about is the solution, just check out the code following this lecture or pause the
video.
You can see the solution here, but I'll go ahead and go to the process of typing this out very quickly.
I'll kind of speed it up.
So what I like to do is start by defining the rough skeleton of what we need in a SQL file.
So we need a create table employees.
And then within that, we'll have ID.
We'll have first name.
We'll have last name.
Middle name.
And then we have age and current status just like that.
And then we can fill in the data types.
So we know ID is an integer and age is an integer.
And then these are var chars for our cars.
Let's say two, five, five.
Some somebody may have a giant name.
And same for current status.
So then the next thing that we could do is focus on on ID, which we know needs to auto increment and
we also want it to be mandatory and a primary key.
So mandatory means not null.
And the primary key, there's actually two options.
The first one is to do this.
And the second one, just duplicate this.
It's also in the slides.
Is to add it on the end here.
We don't want that underscore there.
There we go.
So these will do the same thing.
But of course, we're not done.
So the next thing would be first name.
And first name is just mandatory, as is last name.
So we'll just add not null and not no middle name we can leave alone.
Then we've got age, which is also mandatory.
And then finally current status, which is mandatory, but there's also a default value.
So we want not null default employed and then we need to make sure we have all of the correct commas
here.
Just like that at our semicolon as well.
Copy it and let's see what happens.
All right.
So it looks good.
We can describe employees.
And then if we wanted to, let's just do a single test insert to make sure our default value works in
our auto increment works.
So we'll do insert into employees and we'll do first name, common last name, comment age, and that's
it.
Because everything else either has is allowed to be null or has a default value.
And we'll insert someone with the name of Daura Smith, I guess.
And let's say she is 58.
Copy that.
Paste that in.
Let's do a select star from employees just like that.
And it looks good.
We've got an ID auto incrementing it one.
First name, last name, middle name is null because it's allowed to be age 58 and current status is
employed because we didn't specify one and we have a default value.
All right.
So again, the other solution here is just to put primary key on the same line when you're defining
the column, I prefer to do it that way, but you'll also see it done this way.
Both work.
All right.
That's it.