You are on page 1of 2

SQL queries ran for 10 MCQs

1 What is the hire date of employee no 20003?

SELECT hire_date FROM employees WHERE emp_no = 20003;

2 How many employee records are there in the employee table?

SELECT COUNT(*) FROM employees;

3 What is the employee's birthday, whose first name is Sumant and whose last name is Schade?

SELECT birth_date FROM employees WHERE first_name = 'Sumant' A

4 How many employees have the 'Senior' word in their job title?

SELECT COUNT(*) FROM employees WHERE job_title LIKE '%Senior%';

5 How many employees are in the d005 department?

SELECT COUNT(*) FROM dept_emp WHERE dept_no = 'd005';

6 What are the department numbers of employees 110183, 110303, and 110386?

SELECT DISTINCT dept_no FROM dept_emp WHERE emp_no IN (110183, 110303, 110386);

7 What are the department IDs containing 's' in the department name?

SELECT dept_no FROM departments WHERE dept_name LIKE '%s%';

8 What is the department no of the department manager whose employee ID is 110114?

SELECT dept_no FROM dept_manager WHERE emp_no = 110114;

9 How many employees receive salaries between 10000 and 60000?

SELECT COUNT(*) FROM salaries WHERE salary BETWEEN 10000


10 What is the name of the department where employee number 110420 works?

SELECT d.dept_name

FROM departments d

JOIN dept_emp de ON d.dept_no = de.dept_no

WHERE de.emp_no = 110420;

You might also like