SQL Select statement in database systems

By: Prof. Dr. Fazal Rehman | Last updated: March 3, 2022

What is the SELECT statement?

The select statement is used to display the values from the table.

RollNoNameFee
1Sameed10,000
2Shahzeb10,000
3Basit0.00

Table 1: student

Example 1:

Query on table 1: SELECT * FROM student;

Result:

RollNo
NameFee
1Sameed10,000
2Shahzeb10,000
3Basit0.00

Query show the resultant table: student


Example 2:

Query on table 1: SELECT RollNo, Name FROM student;

Result:

RollNoName
1Sameed
2Shahzeb
3Basit

Query show the resultant table: student


Example 3:

Query on table 1: SELECT RollNo FROM student;

Result:

RollNo
1
2
3

Query show the resultant table: student

 

Leave a Reply