SQL 걷기반

1) 돈을 벌기 위해 일을 합시다!

news0516 2024. 10. 11. 17:16

1. sparta_employees 테이블에서 모든 직원의 이름(name)과 직급(position)을 선택하는 쿼리를 작성해주세요.
SELECT name, 
potiton
FROM sparta_employees


2. sparta_employees 테이블에서 중복 없이 모든 직급(position)을 선택하는 쿼리를 작성해주세요.
SELECT DISTINCT position
FROM sparta_employees

3. sparta_employees 테이블에서 연봉(salary)이 40000과 60000 사이인 직원들을 선택하는 쿼리를 작성해주세요.
SELECT name, 
salary
From sparta_employees
where salary BETWEEN 40000 and 60000

4. sparta_employees 테이블에서 입사일(hire_date)이 2023년 1월 1일 이전인 모든 직원들을 선택하는 쿼리를 작성해주세요.
SELECT name, 
hire_date
FROM sparta_employees
WHERE hire_date < 2023