본문 바로가기

Backend58

[Oracle DB] GROUP BY와 DISTINCT, HAVING 절 DISTINCT컬럼에 중복 내용이 있으면 대표값 1개만 출력- 형식distinct 컬럼명- 적용-- sungjuk 테이블 생성create table sungjuk ( sno int primary key ,uname varchar(50) not null ,kor int check(kor between 0 and 100) ,eng int check(eng between 0 and 100) ,mat int check(mat between 0 and 100) ,addr varchar(50) check(addr in ('Seoul','Jeju','Busan','Suwon')) ,.. 2023. 3. 13.
[JAVA] quiz : if [ 문제 - if ] //문1)임의의 문자가 대문자, 소문자, 기타인지 구분해서 출력하시오char ch='R';if(ch >= 'A' && ch = 'a' && ch = 'A' && ch = 'a' && ch 2023. 3. 13.
[JAVA] Math Math 수학 관련 클래스System.out.println(Math.E);System.out.println(Math.PI);//절대값System.out.println(Math.abs(3));System.out.println(Math.abs(-3));System.out.println(Math.abs(2.4));System.out.println(Math.abs(-2.4)); System.out.println(Math.ceil(1.3)); //2.0 소수점 올림System.out.println(Math.floor(2.7)); //2.0 소수점 버림System.out.println(Math.round(3.8)); //4 반올림System.out.println("-------------------");Sy.. 2023. 3. 13.
[JAVA] conversion 1. 자동 형변환- 정수형 : byte(1 byte) → short(2 byte) → int(4 byte) → long(8 byte)- 실수형 : float(4 byte) → double(8 byte)정수형과 실수형이 연산이 되면 자동으로 실수형화 된다화살표 방향으로의 변환은 형변환 연산자를 사용하지 않아도 자동 형변환 되며, 그 반대 방향으로의 변환은 반드시 형변환 연산자를 써야함byte a=3;int b=a; //자동 형변환long c=b;//a=c; 에러 float d=3.4f;double e=d; //자동 형변환 int kor=80, eng=95, mat=100;System.out.println((kor+eng+mat)/3); //91System.out.println((kor+eng+m.. 2023. 3. 13.