So time to add some data
into this restaurant's table,
because that's what we created it for.
Now, for this, we want to execute another SQL statement
this time, a statement that targets this table
and inserts data.
And now it's the first time that we'll write
a SQL statement from the ground up without configuring it
through some graphical user interface first.
For that, I'll close those tabs here,
and then click this button here to create a new tab
for defining a SQL statement.
And in here, you can write your own SQL code
and then execute it by clicking this flash here.
Now, you can write the same statements we had before here.
So we could again run create table
if we wanted to add a new table to our database.
But here, I don't want to do that.
Instead, I want to insert data into a table
and that can be done by using the Insert Into command.
So by combining the keywords Insert and Into,
these are built in SQL commands that tell the SQL server
that we want to insert some data into some table.
Now, the first piece of information
you need to provide after Insert Into
is then the table name,
where the data should be inserted.
In this case, restaurants.
Either between these backticks,
or if there are no special characters in the table name
just like this.
You can also again say restaurant_finder.restaurants,
but normally, this database should already be selected
and then for queries should automatically run
against this database.
So does this not required here.
Now, as a next step, after defining the table name
where you want to insert values into,
you now need a pair of parentheses.
And between those parentheses,
you refer to the columns into which you want to insert data.
Of course, we want to provide data for all the columns
except for the ID, because that will be set and incremented
automatically as we learned.
So here, we then repeat the column names
into which we want to insert data.
In this case, name and then separated by a comma, type.
So now we're saying that for the new record
that we are about to add,
we want to set values for these two fields,
for these two columns.
But we haven't defined which values should be stored
in this record now.
And for that, we now use the values keyword.
And then after that, again, between parentheses,
the values for these columns in the same order
as you listed the columns here.
So I have name, type.
So I first provide the name value and then the type value
between those brackets here.
And the names should be some text and therefore,
just as in JavaScript, we use quotes here,
double quotes or single quotes, both works.
And then we could say the first restaurant is called
the Web Dev Mealery, super amazing name,
and the type of the restaurant separated by a comma,
and also a string could be Italian,
or German, whatever you want.
And that's now a finished command for inserting a new record
as it's called into this restaurant's table.
We can now execute it by clicking that flash.
And if we do so, down there at the bottom,
we see whether it succeeded or not.
If you got a green check mark, it worked,
and you'll see that one row was affected by this command,
which makes sense because a new row was added.
But now, it would also be nice to see that new row.
And for that, we can run another command
to query the data that's inside of a table.