Insert Command:
By using insert command we can insert values into tables.
Update Command
It is used to modify the existing values in the records of the table.
Delete Command
It is used to delete the existing values in the table.
It is possible to delete only data without structure.
Teacher Table:
Student Table:
Inserting values without using Values keyword
Insert only specific values
Output
Inserting null values
Output
Updating values with condition
Before updating the value:
Output
Updating values without condition:
Output
Deleting records with where condition
Output
Deleting records
Output
Select Command:
The Select statement is used to select data from the table.
Basic Syntax: Select * from table_name;
It is used to select all the records from the table.
Select Specific Columns
We can select required columns in the table.
Syntax: select column 1_name, column 2_name from table_name;
Output
Select with Where Condition
Syntax: select column 1_name, column 2_name from table_name where column_name condition;
Output:
Select Using In operator
The in operator is used to specify multiple values in where clause.
It is like operator.
Syntax: Select column 1_name, column 2_name from table_name where column_name In(value 1,value 2....);
Output:
Select Using Not in operator:
Syntax: Select column 1_name, column 2_name from table_name where column_name Not In(value 1,value 2....);
Output:
Select with Like operator:
The like operator is used in where clause to search for a specified pattern.
There are two symbols which are used in like operator.
1.%: It represents one zero or one or multiple characters.
2._:It represents single character.
'a%': Finds any value that starts with "a"
'%a':Finds any value that ends with "a"
'%a%':Finds any value that have "a" in any position.
'_a%':Finds any value that have "a" in second position.
'a_%_%':Finds any value that start with "a" and area at least 3 characters in the length.
'a%l': Finds any value that starts with "a" and ends with "l".
Ex-1:
Output:
Ex-2:
Output:
Not like Operator:
Output:
Order By:
This keyword is used to arrange the data in ascending or descending order.
By default it arrange the data in ascending order.
In Ascending order
Output:
In Descending order
Output:
Between Operator:
It selects values with in a given range.
Output:
Not Between
Output:
By using insert command we can insert values into tables.
Update Command
It is used to modify the existing values in the records of the table.
Delete Command
It is used to delete the existing values in the table.
It is possible to delete only data without structure.
Teacher Table:
Student Table:
Inserting values without using Values keyword
Insert only specific values
Output
Inserting null values
Output
Updating values with condition
Before updating the value:
Output
Updating values without condition:
Output
Deleting records with where condition
Output
Deleting records
Output
Select Command:
The Select statement is used to select data from the table.
Basic Syntax: Select * from table_name;
It is used to select all the records from the table.
Select Specific Columns
We can select required columns in the table.
Syntax: select column 1_name, column 2_name from table_name;
Output
Select with Where Condition
Syntax: select column 1_name, column 2_name from table_name where column_name condition;
Output:
Select Using In operator
The in operator is used to specify multiple values in where clause.
It is like operator.
Syntax: Select column 1_name, column 2_name from table_name where column_name In(value 1,value 2....);
Output:
Select Using Not in operator:
Syntax: Select column 1_name, column 2_name from table_name where column_name Not In(value 1,value 2....);
Output:
Select with Like operator:
The like operator is used in where clause to search for a specified pattern.
There are two symbols which are used in like operator.
1.%: It represents one zero or one or multiple characters.
2._:It represents single character.
'a%': Finds any value that starts with "a"
'%a':Finds any value that ends with "a"
'%a%':Finds any value that have "a" in any position.
'_a%':Finds any value that have "a" in second position.
'a_%_%':Finds any value that start with "a" and area at least 3 characters in the length.
'a%l': Finds any value that starts with "a" and ends with "l".
Ex-1:
Output:
Ex-2:
Output:
Not like Operator:
Output:
Order By:
This keyword is used to arrange the data in ascending or descending order.
By default it arrange the data in ascending order.
In Ascending order
Output:
In Descending order
Output:
Between Operator:
It selects values with in a given range.
Output:
Not Between
Output: