The and & OR operators are used to filter records based on more than one condition.
The order by statement is used to sort the result set.
The order BY statement sorts records by default in ascending order. You can use the DESC keyword if you want to use descending order.
INSERT INTO inserts a new row into the table.
Grammar:
INSERT into Talbe_name VALUES (value1,value2,...)
You can also make a column that asks for data to be inserted:
INSERT into Table_anme (Column1,column2,...) VALUES (value1, value2,..)
Example:
Insert a new row
"Persons" table
| LastName |
FirstName |
Address |
| City
| Carter |
Thomas |
Changan Street |
Beijing |
SQL statements:
INSERT into Persons VALUES (' Gates ', ' Bill ', ' xuanwumen ', ' Beijing ')
Results
| LastName |
FirstName |
Address |
| City
| Carter |
Thomas |
Changan Street |
Beijing |
| Gates |
Bill |
Xuanwumen 10 |
Beijing |
Insert data in the columns you have made:
INSERT into Persons (LastName, Address) VALUES (' Wilson ', ' champs-elysees ')
Results
| LastName |
FirstName |
Address |
| City
| Carter |
Thomas |
Changan Street |
Beijing |
| Gates |
Bill |
Xuanwumen 10 |
Beijing |
| Wilson |
|
Champs-elysees |
|
Sql-and & OR & Order by & INSERT into