Hello friends,
In my previous article you saw some Structured Query Language (SQL) commands. And now I share some more commands of SQL. If you haven't read my previous article of SQL please then read that article first because in that article I explained how to create databases and tables. Also, how to insert values into the tables and more. So please read the first article from here:
Ok, let's start.
First we show how many values we have in the database as in the following:
The output is:
“LIKE “
Like is used when we want to search for a specific pattern. For example, we only need the person whose name starts with the letter “s” or ends with “z”. So let's see this practically.
- Start with specific character
The output is:
- Ends with specific character
The output is:
- Matched any specific pattern
The output is:
“IN” Operator
The In operator is used to select multiple values.
The output is:
“BETWEEN” Operator
The Between operator is used to select the values between a specific range.
The output is:
“NOT BETWEEN” Operator
The output is:
SQL Alias
SQL alias is used to temporarily rename the table name or column. To make an alias we use the “AS” operator as in the following:
The output is:
Here we can see that “address” is changed to “city”.
ALTER Operator
The Alter operator is used to add, delete or modify the column.
ADD column by ALTER Operator
The output is:
Now if we see the table then it looks like:
Here we can see that one or more columns were added to the column.
DROP column by ALTER Operator
The output is:
Now if we see the table then it looks like:
Here we can see that the address column is dropped from the table.
I close this article here and I think this article will help you . We will start “SQL JOINS” from the next article.