Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

JOB NO: 03

JOB NAME : Application of where clause,order by group, having clause using MySQL.

JOB DETAILS:

Table:

Where (and,or) data query rules:

And:

SELECT Roll,Dept,Age FROM students_table WHERE Roll<=908548 AND Dept="cmt"

OR:

SELECT Roll,Dept,Age FROM students_table WHERE Roll>=908548 OR Dept="cmt"

USING ORDER BY ,DATA ASC & DESC RULES:

ASC:

SELECT * FROM `students_table` ORDER BY Id ASC


DESC:

SELECT * FROM `students_table` ORDER BY Id DESC

USING GROUP BY SUM FACTOR: SELECT Roll,SUM(Marks)FROM students_table GROUP by Roll>=908547

HAVING CONDITION:

SELECT Dept,SUM(Marks)FROM students_table GROUP by Dept HAVING sum(marks)>=510

You might also like