The document details a MySQL session where a database named 'cnc' is created, along with a table 'employee' that stores employee details. Several records are inserted into the table, and various SQL queries are executed to retrieve and analyze employee data, including salary statistics and location counts. The session demonstrates the use of aggregate functions and filtering with conditions.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
7 views
sql1
The document details a MySQL session where a database named 'cnc' is created, along with a table 'employee' that stores employee details. Several records are inserted into the table, and various SQL queries are executed to retrieve and analyze employee data, including salary statistics and location counts. The session demonstrates the use of aggregate functions and filtering with conditions.
mysql> select * from employee where esal=max(esal);
ERROR 1111 (HY000): Invalid use of group function mysql> select * from employee where esal=(select max(esal) from employee); +------+--------+-------+-------+ | eid | ename | eloc | esal | +------+--------+-------+-------+ | 3 | Vishal | Vashi | 89000 | +------+--------+-------+-------+ 1 row in set (0.00 sec)
mysql> select * from employee where esal>(select avg(esal) from employee);
Cloud Computing with AWS: Everything You Need to Know to be an AWS Cloud Practitioner 1st Edition Pravin Mishra - Download the ebook today and own the complete version