MySql Operators
In this video, we are explain MySQL operators in simple and practical way there is mentions. basically there is many types of operators what is operators maybe you know about this but know just in simple words " Operators means:
- Where Clause (Where Operators):
- Used to specify a condition while fetching the data from a single tables or joining with
- Not only used in the SELECT statements, but it is also used in the UPDATE,
Command: SELECT *from employees WHERE emp_id=101;
Where the example mentioned above extracts all the columns from the table ‘employees’
whose emp_id=101.
- SQL Operators -Logical:
Simple Example:
#SQL Operators:
Logical :-
#select* from studs where S_Name= 'Priya' and S_Marks=458; # AND : false
not show
select *from studs where S_Name= 'Shailu' OR S_Marks=456; # OR : True then
show
select *from studs where NOT S_Marks != 456; # NOT : True then show
#select *from studs;
SQL Operators -Logical:
Simple Example:
#SQL Logical Operators:-
#select *from sregsnum where /*Cl_Roll_No = 82025 and */ Cl_Roll_
No <=82089;
#select *from sregsnum where Category= 'GEN';
select *from sregsnum where Cl_Roll_No = 8208
- SQL Operators -Special (vvi):
Simple Queries:-
#select *from sregsnum where Cl_Roll_No between 82020 and 82070;
#select *from sregsnum where Nm_of_Stud like "Raja Kumar";
select *from sregsnum where Nm_of_Stud like "A%";
#select *from sregsnum where Sl_No =null;
#select *from sregsnum where Cl_Roll_No in (82024, 82068, 82020);
#select distinct(Category) from sregsnum;
select distinct(Cl_Roll_No) from sregsnum;
- SQL Operators -Aggregations:
Example of Aggregations :
#select avg(Sl_No) from sregsnum;
#select avg(Study_Fees) from sregsnum;
#select count(*) from sregsnum; # Count total line in table =87
select min(Sl_No) from sregsnum;
select max(Sl_No) from sregsnum;
select sum(Study_Fees) from sregsnum;
I hope this is helpful for you, thanks for watching and learning.
0 Comments