일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- 프록시패턴 #Gof #ProxyPattern #Proxy
- CentOS
- Bridge Pattern #구조패턴 #Structure Pattern
- GOF #
- 데이터베이스
- PostgreSQL
- GoF #빌더패턴 #Builder Pattern
- MariaDB #DB #기본쿼리 #select
- 자바 #인터페이스 #추상클래스 #abstract #
- Today
- Total
목록데이터베이스 (4)
개발자 기초부터 시작하기
CentOS에 PostgreSQL 설치 후 접속해보기. 다운로드 https://www.postgresql.org/ftp/source 에 접속하여 원하는 버전 다운로드 저는 10.8 버전을 다운로드 하였습니다. $ wget https://ftp.postgresql.org/pub/source/v10.8/postgresql-10.8.tar.gz 빌드환경 구성 및 빌드 configure / make / make install (간단 설명) 로 환경을 구성해줍니다. xxxxxxxxxx $ ./configure --prefix=/usr/local/cafe24/pgsql --with-python --with-openssl --enable-nls=ko -- prefix 부분은 수정해서 사용하시면 됩니다 xxxxxxxx..
-- to_date 가 9999년 인건 null임 따로 처리를 해주어야함. select * from salaries where emp_no = 11007 order by to_date desc; -- 예제 1 : 각 사원별로 평균연봉 출력 및 내림차순 정렬. select emp_no, avg(salary) from salaries group by emp_no order by avg(salary) desc; -- 예제 2 : 각 현재 Manager 직책 사원에 대한 평균 연봉은 ? select emp_no, title from titles where title='manager'; select distinct title from titles; -- 예제 3 : 사원별 몇 번의 직책 변경이 있었는지 selec..
-- 날짜형 함수 select CURDATE(), CURRENT_DATE; -- 년월일 select CURTIME(), CURRENT_TIME; -- 시분초 select now(), sysdate(), current_timestamp(); -- 년월일 시분초 -- now 와 sysdate의 차이 select now(), sleep(2), now(); -- now는 결과의 변화가 없음 ( now() 는 상수) select sysdate(), sleep(2), sysdate(); -- sysdate는 2초 뒤의 시간을 반환함. -- date_format .. 되게 다양한 포맷팅들을 지원함.. select date_format( now(), '%Y년 %m월 %d일 %h시 %i분 %s초'); -- '2019년 ..
데이터베이스 및 테이블은 MariaDB 깔면 기본적으로 제공되던 데이터셋을 활용했습니다. -- select 기본 select * from departments; select first_name, gender, hire_date from employees; -- alias (별명) 미활용. select concat(first_name, ' ', last_name), gender,hire_date from employees; -- alias (별명) 활용 select concat(first_name, ' ', last_name) as '이름', gender as '성별', hire_date as '입사일' from employees; -- titles 테이블안의 title 컬럼의 중복값을 제거하고 보여줌. ..