Introduction
You saw some Structured Query Language (SQL) commands in my previous article. And now, I share some more commands of SQL. If you haven't read my previous article on 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.
Before reading this article, I will suggest you all go through my previous article-
Ok, let's start.
First, we show how many values we have in the database as in the following:
Output
"LIKE "
Like is used when searching 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 practice.
Start with a specific character.
Output
It ends with a specific character
Output
Matched any specific pattern
Output
"IN" Operator
The In operator is used to select multiple values.
Output
"BETWEEN" Operator
The Between operator is used to select the values between a specific range.
Output
"NOT BETWEEN" Operator
Output
SQL Alias
SQL alias is used to rename the table name or column temporarily. To make an alias, we use the "AS" operator as in the following:
Output
Here we 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
Output
Now if we see the table, then it looks like this:
Here we can see that one or more columns were added to the column.
DROP column by ALTER Operator
Output
Now if we see the table, then it looks like this.
Here we can see that the address column is dropped from the table.
Summary
I close this article here, and I think this article will help you. We will start "SQL JOINS" in the next article.
Reference