We are now steping into the important part of the database called the select statement.
As we know data is store in the form of table in the relational database. Before getting deeply into the database here is the sample of how the data store in the form of table. Take a look of this table
In this table there are four columns s_no,first_name,last_name,city. The table data is store in a cell in a table cell is nothing but the intersection of row and columns. Generally the value of the table are store in a cell. We can store the different type of data in this cell. Take a look at this image Here we have given the query to select the rows from the table the database server processes this query and retrives the record from the database .
Use of SELECT statement:
- Basic statement to extract the data from the table.
- Retrives data from a table according to our needs.
Syntax:
There are four main field to write a simple select query SELECT is the key word specifying we are going to select the data from the specific table list of column name or all columns name specify the column name or all columns name whose value we are going to select columns names are separated by commas (,) . if we want to select all column of the table then we specify asteric (*) instead of all column. From is the key word which specify where the value are store Table_Name is the name of the table where data is going to be retrieve and finaly we must put end of the select statement with semicolon (;) which is mendatory for all sql statement.
TABLE NAME:FRIENDSDTLS
Now we want to select the data of all field i.e all row and all columns sql query is :
Select * from friendsdtls;
If want to see the s_no,first_name, and city then the sql query is:
Select s_no,first_name, city from friendsdtls;
Here you go a sample video how to select data from table .you can view this video on my you tube channel as well @ http://youtu.be/r-A41Y50sXs
I am interested in hearing your feedback, so that I can improve my articles and learning resources for you.connect with us on facebook, twitter
Great tutorial, Neat and well explain. I luv the Video concept you added to the post making it visually easy to remember. Great Work.
ReplyDeleteKeep it Up.