The SQL Select Statement.
Select SQL statement is used to retrieve data from the database table. Select is type of data query language. The result of statement is table like format called ResultSet.
Select SQL statement is used to retrieve data from the database table. Select is type of data query language. The result of statement is table like format called ResultSet.
SELECT Syntax:
- SELECT Column-Names FROM table_name;
- SELECT * FROM table-name;
Examples Table:
Employee :
id | Emp_name | Age | Salary |
1 | Jebas | 35 | 40,000 |
2 | Thomas | 30 | 80,000 |
3 | Mark | 25 | 40,000 |
4 | Harry | 42 | 50,000 |
5 | William | 45 | 100,000 |
Where Id,Emp_name, Age and Salary are Column-names.
Example SELECT Query:
SELECT ID, EMP_name, Salary FROM Employee;
id | Emp_name | Salary |
1 | Jebas | 40,000 |
2 | Thomas | 80,000 |
3 | Mark | 40,000 |
4 | Harry | 50,000 |
5 | William | 100,000 |
SELECT * FROM EMPLOYEE;
id | Emp_name | Age | Salary |
1 | Jebas | 35 | 40,000 |
2 | Thomas | 30 | 80,000 |
3 | Mark | 25 | 40,000 |
4 | Harry | 42 | 50,000 |
5 | William | 45 | 100,000 |
SELECT ID FROM EMPLOYEE;
id |
1 |
2 |
3 |
4 |
5 |
It return only one column ID.
Thank You. Like Share and Subscribe 👍 folowlect.com
Comments
Post a Comment