기본 콘텐츠로 건너뛰기

SQL 고난이도

1.emp에서 이름, 급여, 커미션 금액, 총액(급여+커미션금액)을 구하여 총액이 많은 순서대로 출력하라.
select first_name, salary, salary*commission_pct, (salary + salary*commission_pct) total from hr_employees where commission_pct is not null

2. 80번 부서의 모든사람들에게 급여의 13%를 보너스로 지불하기로 했다. 이름, 급여, 보너스 금액, 부서번호를 출력하라
select first_name, salary, salary*0.13, department_id from hr_employees where department_id=80

댓글

이 블로그의 인기 게시물

프로그래머스 - 시저 암호

public class Caesar { String caesar ( String s , int n ) { n %= 26 ; String result = "" ; char [] temp = s . toCharArray (); for ( int i = 0 ; i < temp . length ; i ++) { if ( temp [ i ]>= 'a' && temp [ i ]<= 'z' ) temp [ i ] = ( char ) (( temp [ i ]+ n )> 'z' ? ( temp [ i ]+ n - 1 )% 'z' + 'a' : ( temp [ i ]+ n )); else if ( temp [ i ]>= 'A' && temp [ i ]<= 'Z' ) temp [ i ] = ( char ) (( temp [ i ]+ n )> 'Z' ? ( temp [ i ]+ n - 1 )% 'Z' + 'A' : ( temp [ i ]+ n )); result += temp [ i ]; } return result ; } public static void main ( String [] args ) { Caesar c = new Caesar (); System . out . println ( "s는 'a B z', n은 4인 경우: " + c . caesar ( ...