[Coding Test_MySQL] 1. MySQL Test 1~10

김미숙's avatar
Mar 07, 2025
[Coding Test_MySQL] 1. MySQL Test 1~10
  1. 부서번호가 10번인 부서의 사람 중 사원번호, 이름, 월급을 출력하라.
select empno, ename, sal from emp where deptno = 10;
notion image
 
  1. 사원번호가 7369인 사람 중 이름, 입사일, 부서번호를 출력하라.
select ename, hiredate, deptno from emp where empno = 7369;
notion image
 
  1. 이름이 ALLEN인 사람의 모든 정보를 출력하라.
select * from emp where ename = 'ALLEN';
notion image
 
  1. 입사일이 80/12/17인 사원의 이름, 부서번호, 월급을 출력하라.
select ename, deptno, sal from emp where hiredate = '80/12/17';
notion image
 
 
  1. 직업이 MANAGER가 아닌 사람의 모든 정보를 출력하라.
select * from emp where job != 'MANAGER';
notion image
 
  1. 입사일이 81/04/02 이후에 입사한 사원의 정보를 출력하라.
select * from emp where hiredate > 81-04-02;
notion image
 
  1. 급여가 $800 이상인 사람의 이름, 급여, 부서번호를 출력하라.
select ename, sal, deptno from emp where sal >= 800;
notion image
 
  1. 부서번호가 20번 이상인 사원의 모든 정보를 출력하라.
select * from emp where deptno >= 20;
notion image
 
  1. 입사일이 81/12/09 보다 먼저 입사한 사람들의 모든 정보를 출력하라.
select * from emp where hiredate < '1981-12-09';
notion image
 
  1. 입사번호가 7698보다 작거나 같은 사람들의 입사번호와 이름을 출력하라.
select empno, ename from emp where empno <= 7698;
notion image
 
Share article

parangdajavous