SQL – GROUP BY and ORDER BY: Here, we will figure out how to frame records based on certain normal components and Order By to show them in climbing and slipping request.
Syntax:
SELECT column_names FROM table_names WHERE condition
GROUP BY column_name
HAVING condition
ORDER BY column_name ASC/DESC;
Gathering BY is utilized to frame a gathering of records based on a specific regular component in the records. Request BY is utilized to organize record either in rising or dropping request in a table.
Here,
- Column_names: are the name of the fields in the table
- table_name: name of the table from which we need to bring information
- condition: use to channel information
Note: If we don’t indicate ASC or DESC all together BY it will as a matter, of course, accept it as rising request.