Database: employee_hire_evaluation
# employee ( employee_id , name , age , city )
# shop ( shop_id , name , location , district , number_products , manager_name )
# hiring ( shop_id , employee_id , start_from , is_full_time )
# evaluation ( employee_id , year_awarded , bonus )
# hiring.employee_id = employee.employee_id
# hiring.shop_id = shop.shop_id
# evaluation.employee_id = employee.employee_id

Question: How many employees are there?
SQL: select count ( * ) from employee

Question: Count the number of employees
SQL: select count ( * ) from employee

Question: Sort employee names by their age in ascending order.
SQL: select name from employee order by age asc

Question: List the names of employees and sort in ascending order of age.
SQL: select name from employee order by age asc

Question: What is the number of employees from each city?
SQL: select count ( * ) , city from employee group by city

Question: Count the number of employees for each city.
SQL: select count ( * ) , city from employee group by city

Question: Which cities do more than one employee under age 30 come from?
SQL: select city from employee where age < 30 group by city having count ( * ) > 1

Question: Find the cities that have more than one employee under age 30.
SQL: select city from employee where age < 30 group by city having count ( * ) > 1

Question: Find the number of shops in each location.
SQL: select count ( * ) , location from shop group by location

Question: How many shops are there in each location?
SQL: select count ( * ) , location from shop group by location

Question: Find the manager name and district of the shop whose number of products is the largest.
SQL: select manager_name , district from shop order by number_products desc limit 1

Question: What are the manager name and district of the shop that sells the largest number of products?
SQL: select manager_name , district from shop order by number_products desc limit 1

Question: find the minimum and maximum number of products of all stores.
SQL: select min ( number_products ) , max ( number_products ) from shop

Question: What are the minimum and maximum number of products across all the shops?
SQL: select min ( number_products ) , max ( number_products ) from shop

Question: Return the name, location and district of all shops in descending order of number of products.
SQL: select name , location , district from shop order by number_products desc

Question: Sort all the shops by number products in descending order, and return the name, location and district of each shop.
SQL: select name , location , district from shop order by number_products desc

Question: Find the names of stores whose number products is more than the average number of products.
SQL: select name from shop where number_products > ( select avg ( number_products ) from shop )

Question: Which shops' number products is above the average? Give me the shop names.
SQL: select name from shop where number_products > ( select avg ( number_products ) from shop )

Question: find the name of employee who was awarded the most times in the evaluation.
SQL: select employee.name from employee join evaluation on employee.employee_id = evaluation.employee_id group by evaluation.employee_id order by count ( * ) desc limit 1

Question: Which employee received the most awards in evaluations? Give me the employee name.
SQL: select employee.name from employee join evaluation on employee.employee_id = evaluation.employee_id group by evaluation.employee_id order by count ( * ) desc limit 1

Question: Find the name of the employee who got the highest one time bonus.
SQL: select employee.name from employee join evaluation on employee.employee_id = evaluation.employee_id order by evaluation.bonus desc limit 1

Question: Which employee received the biggest bonus? Give me the employee name.
SQL: select employee.name from employee join evaluation on employee.employee_id = evaluation.employee_id order by evaluation.bonus desc limit 1

Question: Find the names of employees who never won any award in the evaluation.
SQL: select name from employee where employee_id not in ( select employee_id from evaluation )

Question: What are the names of the employees who never received any evaluation?
SQL: select name from employee where employee_id not in ( select employee_id from evaluation )

Question: What is the name of the shop that is hiring the largest number of employees?
SQL: select shop.name from hiring join shop on hiring.shop_id = shop.shop_id group by hiring.shop_id order by count ( * ) desc limit 1

Question: Which shop has the most employees? Give me the shop name.
SQL: select shop.name from hiring join shop on hiring.shop_id = shop.shop_id group by hiring.shop_id order by count ( * ) desc limit 1

Question: Find the name of the shops that do not hire any employee.
SQL: select name from shop where shop_id not in ( select shop_id from hiring )

Question: Which shops run with no employees? Find the shop names
SQL: select name from shop where shop_id not in ( select shop_id from hiring )

Question: Find the number of employees hired in each shop; show the shop name as well.
SQL: select count ( * ) , shop.name from hiring join shop on hiring.shop_id = shop.shop_id group by shop.name

Question: For each shop, return the number of employees working there and the name of the shop.
SQL: select count ( * ) , shop.name from hiring join shop on hiring.shop_id = shop.shop_id group by shop.name

Question: What is total bonus given in all evaluations?
SQL: select sum ( bonus ) from evaluation

Question: Find the total amount of bonus given in all the evaluations.
SQL: select sum ( bonus ) from evaluation

Question: Give me all the information about hiring.
SQL: select * from hiring

Question: What is all the information about hiring?
SQL: select * from hiring

Question: Which district has both stores with less than 3000 products and stores with more than 10000 products?
SQL: select district from shop where number_products < 3000 intersect select district from shop where number_products > 10000

Question: Find the districts in which there are both shops selling less than 3000 products and shops selling more than 10000 products.
SQL: select district from shop where number_products < 3000 intersect select district from shop where number_products > 10000

Question: How many different store locations are there?
SQL: select count ( distinct location ) from shop

Question: Count the number of distinct store locations.
SQL: select count ( distinct location ) from shop