SlideShare a Scribd company logo
BETWEEN : it is used to select values within a
range.
SELECT column_name FROM table_name
WHERE column_name BETWEEN value1 AND val
ue2;
SELECT column_name FROM table_name
WHERE column_name NOT
BETWEEN value1 AND value2;
IN :
select column_name from table_name
where column_name in (value1,value2,...);
Example:
Select * from table_name where address in
(‘delhi’ , ‘mumbai’);
Like
It is used only with char and varchar to match a
pattern.
Both % and _ are used with the like operator to
specify a pattern
Select column_name from table_name where
column_name like ‘a%’;
Select column_name from table_name where
column_name like ‘%d’;
Show who have exactly 5 characters
select column_name from table_name where
colun_name like ‘_____’ ; --5 underscores
Show all the column value whoes 2nd character
is ‘d’
Select colun_name from table_name where
column_name like ‘_d%’;
Select colum_name from table_name where
column_name like ‘%a%a%’;
Count (): counts all the rows
SELECT count(*) FROM table_name;
Sum(): it reurns sum of values from the selected list
of column
select sum(column_name) from table_name;
Max(): it returns the maximum value of the
selected list of item
select max(column_name) from table_name;
Min(): it returns the minimum value of the selected
list of item
select min(column_name) from table_name;
Avg(): it returns the average of column valuess
select avg(column_name) from table_name;
lcase() :
Select lcase(column_name) from table_name;
ucase():
Select ucase(column_name) from table_name;
Now(): show current date and time
select now();
Output:
2014-02-20 22:20:08
SELECT date_format( now(), '%W, %D, %M,
%Y,%T')
w – day
D – date
M – month
Y- year
T – time
Output:
Thursday, 20th, February, 2014,22:18:19
GROUP BY
It is used to group the data. In other word it
divide rows in a table in smaller group.
select dept_no,sum(sal) from employee group
by dept_no;
Here,
Employee - table_name
Dept_no and sal - column_name
HAVING
It is used to applied condition on aggregate
functions with group by.
Example:
select dept_no,max(sal) from employee group
by dept_no having sum(sal)>100;

More Related Content

PPT
PDF
Excel Training for SEOs
PPTX
Vlookup Description
PDF
Formulas Cheat Sheet
DOCX
Msql query
PPT
Constraints In Sql
PPTX
Excel presentation
PPT
SQL- Introduction to MySQL
Excel Training for SEOs
Vlookup Description
Formulas Cheat Sheet
Msql query
Constraints In Sql
Excel presentation
SQL- Introduction to MySQL

What's hot (19)

PPT
PPT
PPT
enums
PPTX
VLOOKUP HLOOKUP INDEX MATCH
PPT
Les09 (using ddl statements to create and manage tables)
PPTX
DATABASE CONSTRAINTS
PPTX
Where conditions and Operators in SQL
PDF
Sql integrity constraints
PDF
Chapter9 more on database and sql
PPTX
Commands
PPTX
Fundamentals of C Programming Language
PDF
PDF
R - mean, median and mode
PPTX
How to use Hlookup find an exact match
PDF
SQL Functions - Oracle SQL Fundamentals
PPTX
How to use vlookup in MS Excel
PPT
PDF
03 ohp slides 1
PPT
Intro to tsql unit 11
enums
VLOOKUP HLOOKUP INDEX MATCH
Les09 (using ddl statements to create and manage tables)
DATABASE CONSTRAINTS
Where conditions and Operators in SQL
Sql integrity constraints
Chapter9 more on database and sql
Commands
Fundamentals of C Programming Language
R - mean, median and mode
How to use Hlookup find an exact match
SQL Functions - Oracle SQL Fundamentals
How to use vlookup in MS Excel
03 ohp slides 1
Intro to tsql unit 11
Ad

Viewers also liked (7)

PDF
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
PPTX
Loop
PPTX
Slide Show
PDF
презентация Dancers 2.0
PDF
bccon-2014 com02 level-up_building_next_generation_business_applications
PDF
bccon-2014 dev04 domino_apps_reaching_up&out
PDF
bccon-2014 key01 ibm_collaboration_solutions_connect_2014
bccon-2014 cas01 ibm-notes-upgrades-in-der-kaffeepause
Loop
Slide Show
презентация Dancers 2.0
bccon-2014 com02 level-up_building_next_generation_business_applications
bccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 key01 ibm_collaboration_solutions_connect_2014
Ad

Similar to Mysql (20)

PPTX
V15 like operator-c
PPTX
2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd
PPTX
SQL.pptx SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTE...
PPTX
SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTER SCIENCE...
PPTX
SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTER SCIENCE...
PPTX
SQL.pptx SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTE...
PPTX
PDF
0808.pdf
PDF
0808.pdf
PPT
Chinabankppt
PPT
Module03
DOCX
SQL report
PPTX
ADV Powepoint 3 Lec.pptx
PPT
SQL : introduction
PPTX
Where conditions and Operators in SQL
PDF
dbms.pdf
ODT
PPTX
SQL Tutorial for Beginners
PPT
MY SQL
PPTX
Using basic select statement in oracle database
V15 like operator-c
2 puc cs.pptx bsbshsjshsbbsjsjshdbdbbdbdd
SQL.pptx SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTE...
SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTER SCIENCE...
SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTER SCIENCE...
SQL.pptx SAMPLE QUESTION PAPER (THEORY) CLASS: XII SESSION: 2024-25 COMPUTE...
0808.pdf
0808.pdf
Chinabankppt
Module03
SQL report
ADV Powepoint 3 Lec.pptx
SQL : introduction
Where conditions and Operators in SQL
dbms.pdf
SQL Tutorial for Beginners
MY SQL
Using basic select statement in oracle database

Recently uploaded (20)

PPTX
A Presentation on Touch Screen Technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation theory and applications.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
1. Introduction to Computer Programming.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
A Presentation on Artificial Intelligence
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Hybrid model detection and classification of lung cancer
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Enhancing emotion recognition model for a student engagement use case through...
A Presentation on Touch Screen Technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Encapsulation_ Review paper, used for researhc scholars
Hindi spoken digit analysis for native and non-native speakers
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation theory and applications.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Heart disease approach using modified random forest and particle swarm optimi...
1. Introduction to Computer Programming.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
A Presentation on Artificial Intelligence
SOPHOS-XG Firewall Administrator PPT.pptx
OMC Textile Division Presentation 2021.pptx
cloud_computing_Infrastucture_as_cloud_p
Digital-Transformation-Roadmap-for-Companies.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Zenith AI: Advanced Artificial Intelligence
Hybrid model detection and classification of lung cancer
A novel scalable deep ensemble learning framework for big data classification...
Enhancing emotion recognition model for a student engagement use case through...

Mysql

  • 1. BETWEEN : it is used to select values within a range. SELECT column_name FROM table_name WHERE column_name BETWEEN value1 AND val ue2; SELECT column_name FROM table_name WHERE column_name NOT BETWEEN value1 AND value2;
  • 2. IN : select column_name from table_name where column_name in (value1,value2,...); Example: Select * from table_name where address in (‘delhi’ , ‘mumbai’);
  • 3. Like It is used only with char and varchar to match a pattern. Both % and _ are used with the like operator to specify a pattern Select column_name from table_name where column_name like ‘a%’; Select column_name from table_name where column_name like ‘%d’;
  • 4. Show who have exactly 5 characters select column_name from table_name where colun_name like ‘_____’ ; --5 underscores Show all the column value whoes 2nd character is ‘d’ Select colun_name from table_name where column_name like ‘_d%’; Select colum_name from table_name where column_name like ‘%a%a%’;
  • 5. Count (): counts all the rows SELECT count(*) FROM table_name; Sum(): it reurns sum of values from the selected list of column select sum(column_name) from table_name; Max(): it returns the maximum value of the selected list of item select max(column_name) from table_name; Min(): it returns the minimum value of the selected list of item select min(column_name) from table_name;
  • 6. Avg(): it returns the average of column valuess select avg(column_name) from table_name; lcase() : Select lcase(column_name) from table_name; ucase(): Select ucase(column_name) from table_name; Now(): show current date and time select now(); Output: 2014-02-20 22:20:08
  • 7. SELECT date_format( now(), '%W, %D, %M, %Y,%T') w – day D – date M – month Y- year T – time Output: Thursday, 20th, February, 2014,22:18:19
  • 8. GROUP BY It is used to group the data. In other word it divide rows in a table in smaller group. select dept_no,sum(sal) from employee group by dept_no; Here, Employee - table_name Dept_no and sal - column_name
  • 9. HAVING It is used to applied condition on aggregate functions with group by. Example: select dept_no,max(sal) from employee group by dept_no having sum(sal)>100;