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
Everything, please. I can see it in the table there. It's correct. Can you order it by salary in descending order? | Do you mean the employees who have the letters D or S in their first names? | In their first name, yes. Sorry. I misunderstood.
assistant
SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%';
human
Can you organize the list by salary in descending order?
assistant
SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC;
human
Can you list the first and last names of employees who were hired after 1987?
assistant
SELECT first_name , last_name FROM employees WHERE hire_date > 1987;
human
What are their salaries? Please order the table in ascending order by salary,
assistant
SELECT salary FROM employees WHERE hire_date > 1987 ORDER by salary ;