To select data from the database, we use the SELECT keyword.
Syntax:
SELECT * from Table_Name
The statement is used to display the entire data stored in the table.
Example:
To create table follow this article and for insertion of data read here.
1. Select All Value in a Table
SELECT * from stu;
Output:
2. To Select value of a column by column name
Suppose we need to select all the values in NAME column:
SELECT name from stu;
Output:
You can select more than one column by separating them with comma.
SELECT name, section from stu;
- Log in to post comments