SQL SELECT STATEMENT
SQL SELECT STATMENT :
SELECT is used to select a particular column or show all the data which is stored in the database.
SQL SELECT SYNTAX:
This is item table:
Itemcode |
Itemname |
Price |
4001 |
Pen |
50 |
4002 |
Pencil |
20 |
4003 |
notebook |
40 |
To select column data:
SYNTAX:
SELECT coloumn1,column2......FROM Table_Name;
SELECT coloumn1,column2......FROM Table_Name;
Here, Column1,column2.... are the particular attributes you want to select from the table.
EXAMPLE:
SELECT itemname, itemcode FROM item;
In this it will only show you the result of itemname and itemcode.
SQL SELECT SYNTAX :
To retrieve all the records.
If you want to look for all the columns details that are stored in a table
SYNTAX:
SELECT * FROM Table_Name;
SELECT * FROM Table_Name;
EXAMPLE:
SELECT * FROM item;
In this all the values or data stored in item table will be displayed.
This is the two possible ways to select a record from the database.