SQL Prac 4
SQL Prac 4
Constraints in SQL
Branch no. Name of the employee Employee id salary Manager under work
01 Suresh E1 25000 M1
02 Ramesh E2 22000 M1
03 Dinesh E3 21000 M2
04 Kalpesh E4 20000 M1
05 Alpesh E5 21600 M3
06 Adesh E6 26000 M5
07 Rajesh E7 27000 M3
08 Zareen E8 30000 M4
09 Seema E9 20000 M2
Notice here that using query select max(salary) from Company; you get output 30000 and
using the query select *from company where salary=30000; you get detailed output.
In order to get the details of employees having maximum salary enter the following
select *from company where salary=(select max(salary) from Company);
In order to get the details of employees having minimum salary enter the following
select *from company where salary=(select min(salary) from Company);