Database: hr_1

Question: What are the first name and department name of all employees?
SQL: SELECT T1.first_name ,  T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id  =  T2.department_id

Question: What are the full names and salaries for any employees earning less than 6000?
SQL: SELECT first_name ,  last_name ,  salary FROM employees WHERE salary  <  6000

Question: What are the first names and department numbers for employees with last name McEwen?
SQL: SELECT first_name ,  department_id FROM employees WHERE last_name  =  'McEwen'

Question: What is all the information about the Marketing department?
SQL: SELECT * FROM  departments WHERE department_name  =  'Marketing'

Question: On what dates were employees without the letter M in their first names hired?
SQL: SELECT hire_date FROM employees WHERE first_name NOT LIKE '%M%'

Question: What are the full name, hire date, salary, and department id for employees without the letter M in their first name?
SQL: SELECT first_name ,  last_name ,  hire_date ,  salary ,  department_id FROM employees WHERE first_name NOT LIKE '%M%'

Question: What are the full name, hire data, salary and department id for employees without the letter M in their first name, ordered by ascending department id?
SQL: SELECT first_name ,  last_name ,  hire_date ,  salary ,  department_id FROM employees WHERE first_name NOT LIKE '%M%' ORDER BY department_id

Question: Return the phone numbers of employees with salaries between 8000 and 12000.
SQL: SELECT phone_number FROM employees WHERE salary BETWEEN 8000 AND 12000

Question: Return the full names and salaries for employees with first names that end with the letter m.
SQL: SELECT first_name ,  last_name ,  salary FROM employees WHERE first_name LIKE '%m'

Question: What are the job ids and dates of hire for employees hired after November 5th, 2007 and before July 5th, 2009?
SQL: SELECT job_id ,  hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05'

Question: What are the full names of employees who with in department 70 or 90?
SQL: SELECT first_name ,  last_name FROM employees WHERE department_id  =  70 OR department_id  =  90

Question: What is all the information about employees hired before June 21, 2002?
SQL: SELECT * FROM employees WHERE hire_date  <  '2002-06-21'

Question: What is all the information about employees with D, S, or N in their first name, ordered by salary descending?
SQL: SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' OR first_name LIKE '%N%' ORDER BY salary DESC

Question: Which employees were hired after September 7th, 1987?
SQL: SELECT * FROM employees WHERE hire_date  >  '1987-09-07'

Question: Which job titles correspond to jobs with salaries over 9000?
SQL: SELECT job_title FROM jobs WHERE min_salary  >  9000

Question: What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000?
SQL: SELECT job_title ,  max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000