Exp 6 Group by Having Order by

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

mysql> use sse;

Database changed
mysql> show tables;
+---------------+
| Tables_in_sse |
+---------------+
| bin |
| empdepartment |
| empdept |
| employee |
| mentees |
| student |
| studepartment |
| t |
+---------------+
8 rows in set (0.01 sec)
mysql> select*from mentees;
+-----------+---------+------+---------+------------+-------+---------+
| Regno | Name | Dept | Address | Fathername | Marks | subject |
+-----------+---------+------+---------+------------+-------+---------+
| 192011090 | Gowtham | CSE | Chennai | moorthi | 99 | DBMS |
| 192011079 | arun | BME | nellore | muthu | 91 | BIOEVS |
| 192011095 | Harish | ECE | Madurai | Kannan | 95 | PDSD |
| 192211080 | Dhivya | ECE | Tirupur | Ramesh | 91 | PDSD |
+-----------+---------+------+---------+------------+-------+---------+
4 rows in set (0.00 sec)

mysql> select*from mentees order by Name;


+-----------+---------+------+---------+------------+-------+---------+
| Regno | Name | Dept | Address | Fathername | Marks | subject |
+-----------+---------+------+---------+------------+-------+---------+
| 192011079 | arun | BME | nellore | muthu | 91 | BIOEVS |
| 192211080 | Dhivya | ECE | Tirupur | Ramesh | 91 | PDSD |
| 192011090 | Gowtham | CSE | Chennai | moorthi | 99 | DBMS |
| 192011095 | Harish | ECE | Madurai | Kannan | 95 | PDSD |
+-----------+---------+------+---------+------------+-------+---------+
4 rows in set (0.01 sec)
mysql> select*from mentees group by Marks;
+-----------+---------+------+---------+------------+-------+---------+
| Regno | Name | Dept | Address | Fathername | Marks | subject |
+-----------+---------+------+---------+------------+-------+---------+
| 192011090 | Gowtham | CSE | Chennai | moorthi | 99 | DBMS |
| 192011079 | arun | BME | nellore | muthu | 91 | BIOEVS |
| 192011095 | Harish | ECE | Madurai | Kannan | 95 | PDSD |
+-----------+---------+------+---------+------------+-------+---------+
3 rows in set (0.01 sec)

mysql> select*from mentees group by Dept;


+-----------+---------+------+---------+------------+-------+---------+
| Regno | Name | Dept | Address | Fathername | Marks | subject |
+-----------+---------+------+---------+------------+-------+---------+
| 192011090 | Gowtham | CSE | Chennai | moorthi | 99 | DBMS |
| 192011079 | arun | BME | nellore | muthu | 91 | BIOEVS |
| 192011095 | Harish | ECE | Madurai | Kannan | 95 | PDSD |
+-----------+---------+------+---------+------------+-------+---------+
3 rows in set (0.00 sec)
mysql> select*from mentees having Marks>95;
+-----------+---------+------+---------+------------+-------+---------+
| Regno | Name | Dept | Address | Fathername | Marks | subject |
+-----------+---------+------+---------+------------+-------+---------+
| 192011090 | Gowtham | CSE | Chennai | moorthi | 99 | DBMS |
+-----------+---------+------+---------+------------+-------+---------+
1 row in set (0.00 sec)

You might also like