human
Schema:
regions (REGION_ID, REGION_NAME)
countries (COUNTRY_ID, COUNTRY_NAME, REGION_ID)
departments (DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID)
jobs (JOB_ID, JOB_TITLE, MIN_SALARY, MAX_SALARY)
employees (EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID)
job_history (EMPLOYEE_ID, START_DATE, END_DATE, JOB_ID, DEPARTMENT_ID)
locations (LOCATION_ID, STREET_ADDRESS, POSTAL_CODE, CITY, STATE_PROVINCE, COUNTRY_ID)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the salary and manager number for those employees who is working under a manager.
assistant
SELECT salary , manager_id FROM employees WHERE manager_id != 'null'
human
Display the first and last name, and salary for those employees whose first name is ending with the letter m.
assistant
SELECT first_name , last_name , salary FROM employees WHERE first_name LIKE '%m'
human
What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163?
assistant
SELECT first_name , last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163 )
human
List the full name (first and last name), and salary for those employees who earn below 6000.
assistant
SELECT first_name , last_name , salary FROM employees WHERE salary < 6000
human
What are the full name (first and last name) and salary for all employees who does not have any value for commission?
assistant
SELECT first_name , last_name , salary FROM employees WHERE commission_pct = 'null'
human
What are full names and salaries of employees working in the city of London?
assistant
SELECT first_name , last_name , salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = "London" ;