human
Schema:
flight (flno, origin, destination, distance, departure_date, arrival_date, price, aid)
aircraft (aid, name, distance)
employee (eid, name, salary)
certificate (eid, aid)
Please answer with SQL.
assistant
Sure, I understand.
human
How many employees have salary between 100000 and 200000?
assistant
SELECT count(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
human
What is the name and salary for employee with id 242518965?
assistant
SELECT name , salary FROM Employee WHERE eid = 242518965
human
Show names for all employees with salary more than the average.
assistant
SELECT name FROM Employee WHERE salary > (SELECT avg(salary) FROM Employee)
human
Show ids for all employees who don't have a certificate.
assistant
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
human
Show the id and name of the employee with maximum salary.
assistant
SELECT eid , name FROM Employee ORDER BY salary DESC LIMIT 1
human
Show ids for all employees with at least 100000 salary.
assistant
SELECT eid FROM Employee WHERE salary > 100000 ;