bing
Flat 10% & upto 50% off + 10% Cashback + Free additional Courses. Hurry up
×
UPTO
50%
OFF!
Intellipaat
Intellipaat
  • Live Instructor-led Classes
  • Expert Education
  • 24*7 Support
  • Flexible Schedule

What Is Where in SQL?

‘Where’ as a word is used to distinguish a place or position and that’s exactly what the SQL Where clause does. Where in SQL is used to specify a condition while fetching the data. The Where in SQL fetches only the necessary records.

Watch this Where in SQL video

How to Filter Records with the ‘Where’ in SQL?

Where in SQL is used to filter records on the basis of a condition, or it is used to extract records which satisfy a condition.

In this example, we want to extract those records where the age of a person is more than fifty or sixty out of those records where the occupation of the person is a doctor.

Where Clause in SQL Syntax with an Example

Syntax

SELECT column1, column2, columnN
FROM tablename
WHERE [condition];

where SELECT, FROM, and WHERE are the keywords; column1 to columnN are a set of columns; tablename is the name of the table, and there is a condition followed by a semicolon.

  • Let’s display only the employees from the operations department
    select e_name,e_dept from employee where e_dept=’operation’;

SQL Where Clause Syntax with an Example

  • After writing the query, click on the execute button to check for errors
  • Once the query is executed, the table appears


This bring us to the end of this where in SQL. In the next tutorial section, we will discuss on the imposed operators used with the Where clause, which will help users filter data using multiple constraints.

Previous Next

Download Interview Questions asked by top MNCs in 2019?

"0 Responses on WHERE Clause in SQL"

    100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.
    top

    Sales Offer

    Sign Up or Login to view the Free WHERE Clause in SQL.