0% found this document useful (0 votes)
5 views

Aggregate Func

Uploaded by

anushkaanand2021
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Aggregate Func

Uploaded by

anushkaanand2021
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

aggregate func

mysql> use company;


Database changed
mysql> select * from employee;
+----------+-------+---------+-----------+------------+-------------------------
+------+--------+-----------+-----+
| Fname | Minit | Lname | Ssn | Bdate | Address
| Sex | Salary | Super_ssn | Dno |
+----------+-------+---------+-----------+------------+-------------------------
+------+--------+-----------+-----+
| John | B | Smith | 123456789 | 1965-01-09 | 731 Fondren, Houston TX | M
| 30000 | 333445555 | 5 |
| Franklin | T | Wong | 333445555 | 1965-12-08 | 638 Voss, Houston TX | M
| 40000 | 888665555 | 5 |
| Joyce | A | English | 453453453 | 1972-07-31 | 5631 Rice, Houston TX | F
| 25000 | 333445555 | 5 |
| Ramesh | K | Narayan | 666884444 | 1962-09-15 | 975 Fire Oak, Humble TX | M
| 38000 | 333445555 | 5 |
| James | E | Borg | 888665555 | 1937-11-10 | 450 Stone, Houston TX | M
| 55000 | NULL | 1 |
| Jennifer | S | Wallace | 987654321 | 1941-06-20 | 291 Berry, Bellaire TX | F
| 43000 | 888665555 | 4 |
| Ahmad | V | Jabbar | 987987987 | 1969-03-29 | 980 Dallas, Houston TX | M
| 25000 | 987654321 | 4 |
| Alicia | J | Zelaya | 999887777 | 1968-01-19 | 3321 Castle, Spring TX | F
| 25000 | 987654321 | 4 |
+----------+-------+---------+-----------+------------+-------------------------
+------+--------+-----------+-----+
8 rows in set (0.03 sec)

mysql> select count(fname) from employee;


+--------------+
| count(fname) |
+--------------+
| 8 |
+--------------+
1 row in set (0.04 sec)

mysql> select count(*) from employee;


+----------+
| count(*) |
+----------+
| 8 |
+----------+
1 row in set (0.00 sec)

mysql> select MAX(salary) from employee;


+-------------+
| MAX(salary) |
+-------------+
| 55000 |
+-------------+
1 row in set (0.03 sec)

mysql> select MIN(salary) from employee;


+-------------+
| MIN(salary) |
+-------------+
| 25000 |
+-------------+
1 row in set (0.00 sec)

You might also like