0% found this document useful (0 votes)
51 views1 page

Hive Build in Operators and Functions

The document contains 4 SQL queries: 1) selects all employees with band D1 and salary less than 30000, 2) selects all employees not in band D2, 3) selects the count of employees in band D2, 4) selects the minimum, maximum, and average salary for each band by grouping the results.

Uploaded by

PEPETI RAVI
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
51 views1 page

Hive Build in Operators and Functions

The document contains 4 SQL queries: 1) selects all employees with band D1 and salary less than 30000, 2) selects all employees not in band D2, 3) selects the count of employees in band D2, 4) selects the minimum, maximum, and average salary for each band by grouping the results.

Uploaded by

PEPETI RAVI
Copyright
© © All Rights Reserved
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
You are on page 1/ 1

List out all employees with band as D1 and earning a salary less than 30000.

SELECT * FROM employee WHERE Salary>=30000;


List out all employees who are not in band D2.
SELECT * FROM employee WHERE BAND!=D2;
List how many employees are there in band D2.
SELECT * FROM employee WHERE BAND =D2;
List out the min, max and average salary of each band.
1. select depid, max(salary) as MaxSalary, min(Salary) as MinSalary from table1
group by DepId

You might also like