So now that we've learned how tables work and we've seen a little bit about data types we finally get
to start creating tables.
So here is the magic syntax for creating a new table in my school.
Here is the generic version.
So it's create table and then the name of the table.
So cats or users or people or results or whatever it is.
And then in parentheses a column name and then MySpace and that data type.
And there are a few other things that can come along with the data type but for now we're just talking
about data type.
So a column name like age is an ENT or address is of our chart or our car however you want to pronounce
it.
So that's the main idea.
And you keep listing these columns as many as you need it could just be one it could be 20 and you separate
them by columns excuse me by commas and then when you finish you add your semi-colon and that's that.
And you don't have to format it this way on separate lines but I think it's easiest to understand.
It's definitely easier to read when you get much more complex ones but you could do it all on a single
line just like anything else in my as well.
So here's an actual example using our catch table.
So we're just working with name and age create table cats.
One thing I should point out is that table names should be pluralized so it doesn't actually matter
for the mechanics or behind the scenes that won't change anything.
But you want to just follow this convention use plural because that's what a table describes is multiple
cats or people instead of person or payments instead of payment and so on.
OK.
So we have parentheses and then we list our columns and the corresponding data types so name will be
Vardar with a 100 character limit comma age will be an integer.
So let's hop over to call 9 and see if it works.
So the first thing I'll do is just make a new database.
You don't have to do this if you're following along.
But I'll just call one cat app.
Forgot my semi-colon.
Then we will use.
OK so now the next thing we'll do is create table cat and then we can either do parentheses here and
that's what I usually do when I'm working in the mines.
Q. Well command line or in the shell.
So you don't have to worry about spaces too much.
So create table cats and then we'll say name is var char 100 comma age isn't it.
And then we'll close our parentheses with a semi-colon.
Queery OK.
0 rows effected perfect.
It appears to have worked or at least we have to trust that it works because right now we don't have
a way of testing that.
But we will the next video cliffhanger.