Hello and welcome to the blank and programming language course in the previous session, we talked about
creating a database and table queries and indecision.
We want to talk about the other queries.
Insert into a statement this you'll insert into a statement is used to add new rolls of data to a table
in the database.
It is possible to write the insert into a statement in two ways.
First is specify both the column names and the values to be inserted.
Now you can see the syntax.
And second, if you are adding value for all the colours of the table, you do not need to specify the
column names in this query.
However, make sure the order of the values is in the same order as the columns in the table here.
The inserted into syntax would be as follows.
Now go to my school database to create a new query.
We want to insert values into a student table in person database so people write a new query select
database by the comment and use database name.
So we write query statement use person.
Go to the next line.
First, we create a query for insert values in a stool and table by select some fields of the student
tail.
So the right answer into the student
in parentheses, we said fields that we want insert values to them like name and age, name, comma,
age, clause Frances's and then values open and close branches again and set values for those fields,
for example,
chain for name and 24 for each.
And said, semicolon in the end of this statement, now execute the query in the navigation panel,
right click and select Refresh.
Then we select Person Database and go to Table submenu and right click on this student did and select
the roles limit.
OK, now you can see the new record added to the student table because you insert values for name and
age fields.
Now we clear the last query and create a new query for insert values for all fields.
So we write insert into the student values
and set values for all fields, respectively, for example, two for I.D. and Sit Robert for name and
security as h and execute again a statement go to the Navigator panel, right click and reference wrong
and go to the database person and on the student table, right click and select rules.
Now you can see the new record added to this student data.
In this case, we saw twist or two different values in two different ways.
Inside this student tale, it now goes twist, lies and continue.
Read Operation Statement this Q and select a statement is used to fetch the data from a database table,
which returns these data in the form of a result table.
This result tables are called results sets.
If you want to fit some of the fields variable in the table, then you can use the following syntax
here.
Column one comma column two are the fields of a table whose values you want to fetch.
If you want to fit all the feeds available in the table, then you can use the following syntax.
Now go to my school database to create a new query.
First, clear the last query.
We want to select values from a student table in person database.
So before right and you query select database by the comment use database name.
So write query statement, use person cynical and go to the next line.
We want to create the select query in two ways.
First, select query for some fields of a student table, so we write select right field names that
we want to display like i.e. the common name and continue to query from the student, said Semicolon,
and execute the statement.
Now we can see a student table records were displayed based on the selected fields, I.D. and name.
It's time to create a new query and display on fields of the student table.
So clear the last go
and write select put an asterisk.
The asterisk indicates that all fields in the table should be selected as tar or asterisk from the student's.
Sit semicolon and again, execute the query.
Now we can see a student table records were displayed based on all fields.
OK.
In order not to prolong the time of decision.
Will finish it and we will continue the content in the next session.
Goodbye.