본문 바로가기

Database5

HR Data Base MySQL Subquery 1. Write a query to find the name (first_name, last_name) and the salary of the employees who have a higher salary than the employee whose last_name='Bull'. - select first_name, last_name, salary from employees where salary > (select salary from employees where last_name = 'Bull'); 쿼리를 두 파트로 나누어 생각하면 쉽다. Inner Query (select salary from employees where last_name = 'Bull');와 Outer Query select fir.. 2019. 9. 11.
HR Data Base MySQL Aggregate Functions and Group by exercises 1. Write a query to list the number of jobs available in the employees table. - select count(distinct job_id) from employees; 2. Write a query to get the total salaries payable to employees. - select sum(salary) from employees; 3. Write a query to get the minimum salary from employees table. - select min(salary) from employees; 4. Write a query to get the maximum salary of an employee working as.. 2019. 9. 10.
HR Data Base MySQL Restricting and Sorting Data statement exercises. 출처: https://www.w3resource.com/mysql-exercises/restricting-and-sorting-data-exercises/ 1. Write a query to display the name (first_name, last_name) and salary for all employees whose salary is not in the range $10,000 through $15,000. - select first_name, last_name, salary from employees where salary not between 10000 and 15000; 2. Write a query to display the name (first_name, last_name) and de.. 2019. 9. 9.
HR Data Base MySQL basic SELECT statement exercises. 출처는 https://www.w3resource.com/mysql-exercises/ 1. Write a query to display the names (first_name, last_name) using alias name “First Name", "Last Name" - select first_name "First Name", last_name "Last Name" from employees; 2. Write a query to get unique department ID from employee table. - select distinct department_id from employees; 3. Write a query to get all employee details from the emplo.. 2019. 9. 9.
728x90