Last updated on:August 28th, 2018,

SQL WHERE clause in database systems

What is WHERE clause?

Where clause filters the record from a table according to given condition.

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

Table 1: student

Example 1 of WHERE clause

Query:

SELECT * FROM student  WHERE Name = ‘sameed’;

Note: This will display values from all the table WHERE Name is sameed.

Result:

RollNoNameFee
1Sameed10,000

Query displays the resultant table: student


Example 2 of WHERE clause

Query:

SELECT * FROM student  WHERE Fee = ‘10,000’;

Note: This will display values from all the table WHERE Fee is 10,000.

Result:

RollNoNameFee
1Sameed10,000
2Shahzeb10,000

Query displays the resultant table: student


Example 3 of WHERE clause

Query:

SELECT * FROM student  WHERE Fee <  10000;

Note: This will display values from all the table WHERE Fee is less than 10,000.

Result:

RollNoNameFee
3Basit0.00

Query displays the resultant table: student

0Shares

Leave a Reply

Your email address will not be published.