0% found this document useful (0 votes)
2 views

DB- Lab Manual

This document provides an overview of the WHERE clause in SQL, which is used to filter records based on specified conditions. It includes the syntax for using the WHERE clause, as well as examples of comparison operators that can be utilized to form search conditions. Additionally, it explains the order of execution for the SELECT statement in relation to the WHERE clause.

Uploaded by

gulfamafzal84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

DB- Lab Manual

This document provides an overview of the WHERE clause in SQL, which is used to filter records based on specified conditions. It includes the syntax for using the WHERE clause, as well as examples of comparison operators that can be utilized to form search conditions. Additionally, it explains the order of execution for the SELECT statement in relation to the WHERE clause.

Uploaded by

gulfamafzal84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab 03 – Lab Manual

Database Systems – Lab 03


 WHERE clause:
The WHERE clause in SQL is used to filter records from a table based on specified conditions.
It allows users to retrieve only those rows that meet certain criteria, reducing the amount of
data retrieved and making queries more efficient.

SYNTAX: SELECT column1, column2, ...


FROM table_name
WHERE search_condition;

The search_condition is a combination of one or more expressions using the comparison


operator and logical operator. The SELECT statement will include any row that satisfies the
search_condition in the result set.

When executing a SELECT statement with a WHERE clause, MySQL evaluates the WHERE
clause after the FROM clause and before the SELECT clauses:

 WHERE Statement with Comparison Operators:


The following comparison operators can be used in the where clause to make the search
condition:

Comparison Operators
= Equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
<> Not equal to

Example Statements:

mysql> SELECT * FROM shipment WHERE destination = "London";

mysql> SELECT * FROM shipment WHERE destination <> "London";

1
Database Systems – Lab 03

You might also like