0% found this document useful (0 votes)
8 views3 pages

MySQL Where Command: Operators Guide

The document outlines a program demonstrating the use of the 'where' command in SQL with logical and relational operators. It provides examples using logical operators such as 'and', 'or', and 'not', as well as relational operators like less than, more than, less than equal to, more than equal to, and not equal to. Each example includes a SQL query to illustrate the application of these operators in selecting data from a database table named 'bca'.
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)
8 views3 pages

MySQL Where Command: Operators Guide

The document outlines a program demonstrating the use of the 'where' command in SQL with logical and relational operators. It provides examples using logical operators such as 'and', 'or', and 'not', as well as relational operators like less than, more than, less than equal to, more than equal to, and not equal to. Each example includes a SQL query to illustrate the application of these operators in selecting data from a database table named 'bca'.
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

Program 4

Write a program to show the use of where command using logical,


relational operator.
1. Logical operator:
a. and (&&):
 mysql> select * from bca
-> where name="mehak" && marks="489";

b. or (||):
 mysql> select * from bca
-> where name="mehak" || marks<="400";

c. not (!):
 mysql> select * from bca
-> where name!="mehak";
2. Relational operator:
a. Less than (<):
 mysql> select * from bca
-> where marks<"410";

b. More than (>):


 mysql> select * from bca
-> where marks>"410";

c. Less than equal to (<=):


 mysql> select * from bca
-> where marks<="398";
d. More than equal to (>=):
 mysql> select * from bca
-> where marks>="398";

e. Not equal to (!=):


 mysql> select * from bca
-> where marks!="500";

You might also like