It's time for you to practice creating and dropping your own table.
This will be quick.
Here we are.
Instructions.
I'd like you to create a pastries table called pastries.
And it has two columns.
A name and a quantity.
Name should be the name of a pastry.
What's a pastry?
Muffin, croissant.
And then also the quantity, which should be a number.
An integer.
So create that and then inspect it.
Make sure those columns exist.
I said in the class and the command line, if you're not using the command line, then just inspect
it, using the workbench or some other tool.
Make sure those columns and types are correct and then delete the table.
So posit.
Try this on your own.
Hopefully it just takes you a minute or two and here is a solution.
So I'm going to run a create table.
I'll just do it in my database I'm currently using.
So I'm going to drop the table immediately after.
So create table pastries and then I need parentheses somewhere.
I'll do it on one line.
Let's see if it fits.
So Pastries is going to have name, which is supposed to be text up to 50 characters, var char 50 and
then it would need to have quantity, which is an integer quantity int.
Just like that.
I'm missing a closing, Perrin.
It's already looking bad on a single line.
It'd be better to put some returns in there.
But this should work, right.
Create table pastries.
Opening Perrin.
Closing.
Perrin.
Name is of our car.
50 up to 50 characters.
Quantity is an integer and it looks like it worked.
How do we know?
First step.
We could do show tables.
There it is.
Pastries.
What else can we do?
We can describe pastries.
And there we are.
Name is of our car 50.
Quantity is an integer.
And then, of course, we can use one of our tools and refresh the tables.
And we should see pastries.
Is here.
Name of our car 50 quantity integer.
Same thing in the workbench refresh.
I'm not going to keep doing this throughout the whole course, showing you every option, but it's still
early on.
So instead of tables we see pastries and down here it says name var 50 quantity int and then the last
thing we'll do is delete the table.
So I'm going to do that from the command line, drop table pastries and we know it worked.
If I try and describe that table, we get an error.
If I do show tables, it's empty.
If I refresh over here, it's gone.
So that's our first little basic exercise creating a table, inspecting it and dropping it.