*.Join
- join의 개념
- join의 종류
*.카르테시안 product 기법(기본)
Cross조인(모든 정보를 보여줌)
ex)
select * from emp, dept;
ex)
select * from emp cross join dept;
ex)
SQL> select ename, deptno, dname
  2  from emp,dept
  3  ;
select ename, deptno, dname
              *
1행에 오류:
ORA-00918: 열의 정의가 애매합니다
-- 어느테이블 소유인것인지 명확하게 해주면 해결
-- "."(dot)을 이용해서 사용.
table명.컬럼명

SQL>
select emp.ename, emp.deptno, dept.dname
from emp,dept

- 테이블명 단축도 가능(alias사용가능-테이블은 공백만사용)
select a.ename, a.deptno, b.dname
from emp a, dept b


*.EQUI Join 기법 : 동일한 값으로 조인하는방법
1.각 테이블의 동일한값을 where에 =로 명시 [where 에 동일값 표시]
ex)
select emp.ename, emp.deptno, dept.dname
from emp,dept
where emp.deptno = dept.deptno

2.join ~ on : from절에 테이블명 join ~ on 비교될 컬럼명.
ex)
select e.ename, e.deptno, d.dname
from emp e join dept d on e.deptno = d.deptno

3.join ~ using(~) : from절에 테이블명 join ~ using(컬럼명) 사용가능
ex)
select e.ename, deptno, d.dname
from emp e join dept d using(deptno)

4.natural join : Oracle에 알아서 명시해라.
select e.ename, deptno, d.dname
from emp e natural join dept d


*.Non-EQUI Join 기법 : 특정범위값으로 조인하는 방법
 -- 사원명, 급여, 급여등급(등급당 최저급여, 등급당 최급여) 조회
select a.ename, a.sal, b.grade, b.losal, b.hisal
from emp a, salgrade b
where a.sal between b.losal and b.hisal


Posted by 말없제이
,

*.날짜함수

  1  select sysdate, sysdate-1, sysdate+1, to_char(sysdate+(1/2),'yy-mm-dd hh24:mi')
  2* from dual
  3  /

SYSDATE  SYSDATE- SYSDATE+ TO_CHAR(SYSDAT
-------- -------- -------- --------------
09/06/26 09/06/25 09/06/27 09-06-26 21:37

*.months_between : 날짜와 날짜사이의 개월을 계산

  1  select sysdate,months_between(sysdate,to_date('2009-01-01'))
  2  from emp
  3* where empno=7788
SQL> /

SYSDATE  MONTHS_BETWEEN(SYSDATE,TO_DATE('2009-01-01'))
-------- ---------------------------------------------
09/06/26                                    5.82029757

*.add_months : 날짜에 개월을 더한 날짜 계산.

  1  select sysdate,add_months(sysdate,2)
  2  from emp
  3* where empno=7788
SQL> /

SYSDATE  ADD_MONT
-------- --------
09/06/26 09/08/26

*.last_day : 해당월의 마지막일
*.next_day : 다가오는 요일의 날짜를 반환.


  1  select sysdate, last_day(sysdate), next_day(sysdate,'토')
  2  from emp
  3* where empno=7788
SQL> /

SYSDATE  LAST_DAY NEXT_DAY
-------- -------- --------
09/06/26 09/06/30 09/06/27

*.round/trunc : 적용될 날짜형태받아서 하위에서 반올림/절삭

  1  select sysdate, round(sysdate,'mm'), trunc(sysdate,'dd')
  2  from emp
  3* where empno=7788
SQL> /

SYSDATE  ROUND(SY TRUNC(SY
-------- -------- --------
09/06/26 09/07/01 09/06/26

  1  select sysdate, to_char(round(sysdate,'hh'),'yy/mm/dd HH24:mi:ss'), trunc(sysdate,'hh')
  2  from emp
  3* where empno=7788
SQL>
SQL> /

SYSDATE  TO_CHAR(ROUND(SYS TRUNC(SY
-------- ----------------- --------
09/06/26 09/06/26 11:00:00 09/06/26


  1  select sysdate, to_char(sysdate,'ddd'), to_char(sysdate,'dd'), to_char(sysdate,'d')
  2  from emp
  3* where empno=7788
SQL> /

SYSDATE  TO_ TO T
-------- --- -- -
09/06/26 177 26 6


*.Null관련 함수
- nvl(exp1, exp2) : 첫인수가 null이면 두번째인수로 대체
- nvl2(exp1, exp2, exp3) : 첫인수가 null가 아니면 두번째 인수대체, null이면 세번째 인수대체

  1  select comm, nvl(comm, 90), nvl2(comm,999,90)
  2  from emp
  3* where sal >= 1500
SQL> /

      COMM NVL(COMM,90) NVL2(COMM,999,90)
---------- ------------ -----------------
       300          300               999
                     90                90
                     90                90
                     90                90
                     90                90
                     90                90
         0            0               999
                     90                90

- nullif : 함수 두개의 표현식을 비교해 동일하면 null, 일치하지않으면 첫번째값 반환.
nullif(exp1, exp2)

SQL> select comm, nullif(comm, 0)
  2  from emp
  3  where comm is not null
  4  ;

      COMM NULLIF(COMM,0)
---------- --------------
       300            300
       500            500
      1400           1400
         0

- coalesce : 인수중의 null아닌 첫번째 인수 반환. 없으면 null.
  1  select comm, coalesce(comm, 77)
  2* from emp
SQL> /

      COMM COALESCE(COMM,77)
---------- -----------------
                          77
       300               300
       500               500
                          77

*.decode 함수 : if~case 알고리즘 간단한표현, 연산자는 '='만 가능. 불만족시 null반환.
decode(표현식|컬럼명, 찾는값1, 리턴값1, 찾는값2,리턴값2, [default값])

  1  select ename, sal, decode(ename, 'ALLEN', sal)
  2* from emp
SQL> /

ENAME             SAL DECODE(ENAME,'ALLEN',SAL)
---------- ---------- -------------------------
SMITH             800
ALLEN            1600                      1600
WARD             1250
JONES            2975
MARTIN           1250
BLAKE            2850
CLARK            2450
SCOTT            3000
KING             5000
TURNER           1500
ADAMS            1100


SQL> -- 10번 부서 급여 100 추가
SQL> -- 20번 부서 급여 200추가
SQL> -- 그외 9000 일괄 지급
  1  select ename, deptno, decode
  2  (
  3   deptno, 10, sal+100,
  4   20, sal+200,
  5   9000
  6  )
  7* from emp
SQL> /

ENAME          DEPTNO DECODE(DEPTNO,10,SAL+100,20,SAL+200,9000)
---------- ---------- -----------------------------------------
SMITH              20                                      1000
ALLEN              30                                      9000
WARD               30                                      9000
JONES              20                                      3175
MARTIN             30                                      9000
BLAKE              30                                      9000
CLARK              10                                      2550
SCOTT              20                                      3200
KING               10                                      5100
TURNER             30                                      9000
ADAMS              20                                      1300

*.case 함수
decode함수기능 확장, 산술연산, 관계연산, 논리연산 비교가능.
case [표현식] when 조건 then 조건만속시 실행코드
else 이후 불만족시 코드.
end


SQL> --급여가 1300이하이면 '급여올려주삼'
SQL> --1300초과하면서 2999이하이면 '나도 올려줘'
SQL> --2999초과 4000이하 '희망~!'
SQL> --그 외 '나두~~'

  1  select ename, sal,
  2  case when sal<1300 then '급여올려주삼'
  3   when sal>=1300 and sal<=2999 then '나도 올려줘'
  4   when sal<4000 then '희망!'
  5  else '나두~~'
  6  end
  7* from emp
SQL> /

ENAME             SAL CASEWHENSAL<
---------- ---------- ------------
SMITH             800 급여올려주삼
ALLEN            1600 나도 올려줘
WARD             1250 급여올려주삼
JONES            2975 나도 올려줘
MARTIN           1250 급여올려주삼
BLAKE            2850 나도 올려줘
CLARK            2450 나도 올려줘
SCOTT            3000 희망!
KING             5000 나두~~



===============
1. 사원명, 급여 "한달급여", "일당" 구하기 / 한달 20일근무
 select ename, sal, sal/20
 from emp

2. 사원명,입사일,입사한 달의 근무일수 출력(날마다 근무)
select ename, hiredate, last_day(hiredate)-hiredate
from emp

3. 우리 과정 개강한지 오늘로 몇일?
select sysdate-to_date('2009-05-25','yyyy-mm-dd')
from dual


Posted by 말없제이
,

*.함수
- 집계함수
- 문자/숫자/날짜 함수
- 형변환함수(to_char/number/date)

- 명시적 함수
- 묵시적 함수
---
*.문자함수
instr('대상문자열',찾는문자,시작위치,몇번째것을 찾을건지);
substr('대상문자열',시작위치,length);

*.숫자함수
- round : 반올림 : round(123.17,1) -> 123.2
소수점 반올림수 : 순간해놓으면 나중에 아차하는.
3__6__2_._7_1_2;
-3_-2_-1__0 1 2
- trunc : 절삭 : trunc(123.17, 1) -> 123.1
select round(362.712,-2), round(362.712,0), round(362.712), round(362.712,1)
from dual

ROUND(362.712,-2) ROUND(362.712,0) ROUND(362.712) ROUND(362.712,1)
----------------- ---------------- -------------- ----------------
              400              363            363            362.7

- mod : 나머지값 : mod(12,10) -> 2
- ceil : 지정한 값보다 큰수중 가장작은정수 : ceil(123.17) -> 124
- floor : 지정한 값보다 작은수중 가장큰정수 : floor(123.17) -> 123
select ceil(123.17), floor(123.17), ceil(-123.17), floor(-123.17), mod(12,10)
from dual

CEIL(123.17) FLOOR(123.17) CEIL(-123.17) FLOOR(-123.17) MOD(12,10)
------------ ------------- ------------- -------------- ----------
         124           123          -123           -124          2

- sign : 기호를 반환. 양수이면 1, 0이면 0, 음수이면 -1..

SQL> select sign(10), sign(0), sign(-10)
  2  from dual;

  SIGN(10)    SIGN(0)  SIGN(-10)
---------- ---------- ----------
         1          0         -1

*.데이터 타입의 변환
to_char(날짜, 날짜시간format')
to_char(숫자, 'formaht

select ename, sal, to_char(round(sal/13, 1),'999.9') as monthSal
from emp
order by sal asc
ENAME             SAL MONTHS
---------- ---------- ------
SMITH             800   61.5
....
MARTIN           1250   96.2
MILLER           1300  100.0

to_date(' ', '날짜시간format') : 문자를 date형으로 변환.


=========================
1.자신의 생년월일을  년도4자리-월영문축약-일두자리 출력
select to_char(to_date('2079329','yyyymmdd'), 'yyyy-mon-dd') from dual
2.November27을 11월 27일로 출력
select to_char(to_date('November27','monthdd'), 'yy"월" dd"일"') from dual


select to_number('10') from dual


-- 20번 부서사원명, 부서번호 조회
select ename, deptno
from emp
where deptno=to_number('20')

Posted by 말없제이
,

*.함수
함수명(~)

SQL> -- 업무별 최고급여,최저급여,총급여,평균급여, 인원수 조회
SQL> select job, max(sal), min(sal), sum(sal), avg(sal), count(*)
  1  from emp
  2  group by job
  3  ;
SQL> /

JOB         MAX(SAL)   MIN(SAL)   SUM(SAL)   AVG(SAL)   COUNT(*)
--------- ---------- ---------- ---------- ---------- ----------
ANALYST         3000       3000       6000       3000          2
CLERK           1300        800       4150     1037.5          4
MANAGER         2975       2450       8275 2758.33333          3
PRESIDENT       5000       5000       5000       5000          1
SALESMAN        1600       1250       5600       1400          4

*.group by ~ havaing ~ ... : 그룹별로 구분
select ~
from ~
[where 조건]
[group by 기준]
[having 그룹조건]
[order by 정렬]

SQL> --급여가 3000이상되는 사원에 한해
SQL> --업무별 최고급여가 2000 초과하는...
SQL> edit
1  select job, max(sal), min(sal), sum(sal), avg(sal), count(*)
2  from emp
3  group by job
4* having max(sal)>2000
L> /

B         MAX(SAL)   MIN(SAL)   SUM(SAL)   AVG(SAL)   COUNT(*)
------- ---------- ---------- ---------- ---------- ----------
ALYST         3000       3000       6000       3000          2
NAGER         2975       2450       8275 2758.33333          3
ESIDENT       5000       5000       5000       5000          1

ex)
select deptno, max(sal), min(sal), (max(sal)-min(sal)) as cap
from emp
--where deptno in (20,30)
group by deptno
having min(sal)>2500 and deptno in (20,30)
/

*.문자함수
trim( ) : 공백 제거
Rtrim('~','A') : 오른쪽으로 잘라버림
Ltrim('~','A') : 왼쪽으로 잘라버림
ex)

  1  select rtrim('과학수사과','과'), ltrim('과학수사과','과'), trim('    ab     ')
  2* from dual
  3  ;

RTRIM('  LTRIM('  TR
-------- -------- --
과학수사 학수사과 ab


Rpad('~',20,'#') : ~부분 오른쪽을 ~포함 20자리로 만들고 부족한 부분은 '#'으로 채워넣음.
Lpad('~',20,'#') : ~부분 왼쪽을 ~포함 20자리로 만들고 부족한 부분은 '#'으로 채워넣음.
ex)

L> select rpad('www',10,'*'), lpad('www',10,'*')
2  from dual
3  ;

AD('WWW' LPAD('WWW'
-------- ----------
w******* *******www

length() : 문자열 길이 구하는 함수
lengthb() : 문자열을 비트로 구하는 함수
  1  select length('oracle'), length('오라클')
  2* from dual
  3  ;

LENGTH('ORACLE') LENGTH('오라클')
---------------- ----------------
               6                3

SQL>

instr(문자열, '특정문자', 시작위치, 번째) -> position
 
SQL> select instr('ORCLE','LE')
  2  from dual
  3  ;

INSTR('ORCLE','LE')
-------------------
                  4

--사원이름에 L이 포함되는 사원에 한해.
--사원이름에 L이 몇번째 위하는 지 출력.

  1  select ename, instr(ename, 'L')
  2  from emp
  3* where instr(ename, 'L') > 0
SQL> ;
SQL> /

ENAME      INSTR(ENAME,'L')
---------- ----------------
ALLEN                     2
BLAKE                     2
CLARK                     2
MILLER                    3


str(문자열, 시작위치, length) -> 문자열 형태로 리턴.
 
  1  select substr('oh~happy!day', 4,3), substr('oh~happy!day', -4,3)
  2* from dual
  3 
SQL> /

SUB SUB
--- ---
hap !da

-. 80년 11월 23일 표시
  1  select substr('801123-1234567',1,2)||'년 '
  2  ||substr('801123-1234567',3,2)||'월 '
  3  ||substr('801123-1234567',5,2)||'일'
  4* from dual
SQL> /

SUBSTR('801123
--------------
80년 11월 23일


전화번호 02)112-3444 중간번호 추출
select substr
(
'031)2222-1111',instr('031)2222-1111',')')+1,
 (
 instr('031)2222-1111','-') - (instr('031)2222-1111',')')+1)
 )
) as '지역번호'
from dual

Posted by 말없제이
,

*.비교연산자II(%,_)
LIKE A ~~~ : 애매모호한 범위 나타냄.. A 머시기~~~
% : 0개이상의 자릿수
_ : 1개 자릿수.
escape '~' : ~문자뒤에 있는 %,_은 %,_가 아니라 단순히 문자라는 표시.

ex) %
select * from emp
where ename like 'A%'

select * from emp
where ename like '%N'

*.입력
insert into 테이블명[(컬럼명, 컬럼명,..)]
values(값, 값,..)
ex)
 insert into emp(empno, ename)
 values(8000,'세바스%찬')
ex)
 insert into emp(empno, ename)
 values(8100,'마이_콜')

위내용 검색시... %, _로 검색시.
escape 사용
ex) 세바스%찬 찾기.
select *
from emp
where ename like '%#%%' escape '#'
ex) 마이_콜 찾기..
select * from emp where ename like '%@_%' escape '@'

*.삭제
delete [from] 테이블명 [where 조건]
ex) %들어간것 삭제
delete from emp
where ename like '%#%%' escape '#'

*.함수(function)
- 함수명(~~)
 .max/min : 해당열의 최대/최소값
 .sum/avg : 해당열의 총합/평균값
 .count : 행의 갯수카운트.
 .stddev
ex)
 select max(sal), min(sal), sum(sal), avg(sal)
 from emp
ex) -- 소문에 듣는 count(*), count(컬럼명) 차이,
-- *은 컬럼검색없이 rows계산, 컬럼명은 컬럼명검색후 계산
 select count(*), count(sal)
 from emp
- 그룹함수
 select ~
 from 테이블명
 group by 그룹기준
 

Posted by 말없제이
,

계정은 scott/tiger

1. xx번 부서는 ~~~ ->출력. concat 사용.
select concat(deptno, '번 부서는' || dname)
from dept;

2. 커미션이 확정된 사원의 사원번호,사원명,급여, 커미션 조회
select empno, ename, sal, comm
from emp
where comm is not null

3. 2번결과내 급여가 1500 이상인 사원번호,사원명,급여,커미션 조회
select empno, ename, sal, comm
from emp
where comm is not null and sal >= 1500

4. 3번결과를 급여 오름차순 조회.
select empno, ename, sal, comm
from emp
where comm is not null and sal >= 1500
order by sal asc

5.10번또는 20번 부서에 근무하는 사원들의
부서번호,사원명,급여,커미션,bonus를 bonus 오름차순, 동일보너스내 사원명 오름차순
bonus=기본 커미션+300. 커미션이 null이면 50을 기본커미션으로 함.
select empno, ename, sal, comm, (nvl(comm, 50)+300)as bonus
from emp
where deptno in (10, 20)
order by bonus asc, ename

Posted by 말없제이
,

조건에 관한 연습.

*.오라클 내장함수

*.연결연산자(Concatenation) : ||
컬럼사이 특정값을/컬럼을 한줄로 출력할수 있음.
ex)
select dname || ' 부서코드는 ' || deptno from dept;
OPERATIONS 부서코드는 40

*.함수명(~~,~~) : parameter, argument, 인수, 인자, 매게변수
concat(표현식, 표현식~~)
ex)
select concat(deptno, '번 부서')
3개를 넣으면 concat내에서는 인수2개받은 방법이라..

select concat(deptno, '번 부서 : ' || dname)
from dept;

*.현재 날짜와 시간조회.
 select sysdate from dual
 
 *.일시적으로 시간 변형함수.(형변환 함수사용)
To_Char(날짜, '날짜시간Format')
ex)
select sysdate, to_char(sysdate, 'yyyy/mm/dd HH:mi:ss') from dual
ex) 월표시
select sysdate, to_char(sysdate, 'yyyy/month/dd HH:mi:ss') from dual
09/06/22 2009/june     /22 09:49:37  --공백도 포함
ex) 월 축약
select sysdate, to_char(sysdate, 'yyyy/mon/dd HH:mi:ss') from dual
09/06/22 2009/jun/22 09:49:37
ex) 요일, 24시간 표시
select sysdate, to_char(sysdate, 'yyyy/mon/dd day HH24:mi:ss') from dual
ex) 서기-- 표시
select sysdate, to_char(sysdate, 'BC yyyy-mon-dd day HH24:mi:ss AM') from dual

*.alter session set NLS_Date_Format = '날짜시간format'
 alter session set nls_date_format= 'yyyy/mm/dd hh24:mi:ss';

 *.조건문(where) 사용.
select ~
from 테이블명
[where 조건]
[order by 정렬명 정렬방식]
ex)
select empno, deptno
from emp
where deptno=10
order by deptno asc

*.논리 연산자 :
~ or ~ : 단하나라도 만족해도
~ and ~ : 모두 만족해야.
not : 아닌값.
in(값,값) : 값인것..

ex) or
select empno, deptno
from emp
where deptno=10 or deptno=20

ex) in
select empno, deptno
from emp
where deptno in (10, 20)
order by deptno asc

ex) not in
where deptno not in (10, 20)

ex) 10과 30사이
where deptno between 10 and 30
where deptno not between 10 and 30

*.비교연산자 : 기준 비교방법 비교할값
a > b : a는 b보다 크다(초과)
a >= b : a는 b보다 크거나 같다.(이상)
a < b : a는 b보다 작다(미만)
a <= b : a는 b보다 작거나 같다(이하)
a <> b : a는 b와 같지 않다.
a != b : a는 b와 같지 않다.
ex) 1500 이상 2850이하.
select  ename, sal
from emp
where sal>=1300 and sal<=2850
order by sal asc
ex)
select  ename, sal
from emp
where sal between 1300 and 2850
order by sal asc

*.문자처리함수
Upper(~) : 대문자로 처리함수.
Lower(~) : 소문자로 처리함수
initcap(~) : 앞문자만 대문자처리함수
ex)
 select empno, lower(ename), initcap(ename), sal, hiredate
 from emp
 where ename=upper('allen')

*.NULL 조회...
 where comm is null
 where comm is not null
 null은 미확정값이므로 정렬시 무한대로 인식.

*.null과 관련된 함수
nvl(colum, ~) : null일경우 그 컬럼을 ~으로 처리.
ex)
select ename, sal, comm, nvl(comm,100), nvl(comm,100)+sal, nvl(sal+comm,100+sal)
from emp
order by comm asc

Posted by 말없제이
,

-- 주석처리
/* 다중주석처리 */  

*.조회
select {*|컬럼명} from table명;

*.정렬
select {*|컬럼명}
from table명
order by 컬럼명 {desc(내림차순) | [asc](오름차순) [,정렬기준2]};
..오름차순 작->큰, a-z, A-Z,ㄱ-ㅎ,날짜 순
...
order by [번째숫자로 대용가능]
ex)
select ename, deptno, sal
from emp
order by deptno, 3 desc, enam

*.distinct 중복한것 한개만.
select {distinct|[all]} 컬럼명 from 테이블명;
all 모두

*.컬럼명에 이름 붙이기.(alias)
select 컬럼명 [as ]바꿀이름
from table명
- " " : 공백이 있을경우 반드시 사용, 한글은 사용안해도 되지만 사용. 소문자, 특수문자

*.산술연산 가능.
ex)
select empno, sal, sal*13 as 년봉
from emp
order by empno, sal

*.연산(+,-,*,/)시 등의 더미테이블(dual) 사용
dual..
ex)select 1+1 from dual

*. /, run 차이점(run 은 쿼리 한번 더 보여줌)


Posted by 말없제이
,

오라클 접속
방법 1.
.DOS모드 접속
-cmd
-sqlplus [유저명/비밀번호]

.사용자확인
show user

방법 2.
-SQL*Plus

방법 3.
.. 다른프로그램들..


- - - - - -
*.sql은 ;로 끝나며 실행됨.
현재 사용자를 보여줌.
select username from dba_users;


*.사용자 변경
conn[ect] user명/비번
ex)connect scott/tiger
.scott/tiger : 임시로 테스트가능하도록 권한연습위한 계정.

sys로 사용자 변경.
SQL> connect /as sysdba
연결되었습니다.
SQL> show user
USER은 "SYS"입니다.

c:\sqlplus "/as sysdba"

*.ed[it] : 버퍼에 마지막으로 사용된 쿼리명령어 편집가능.
편집후 실행은 sql에서 "/"로 실행
SQL> edit
file afiedt.buf(이)가 기록되었습니다

  1  alter user hr
  2* account unlock
  3  /

사용자가 변경되었습니다.

SQL> conn hr/hr
ERROR:
ORA-01017: invalid username/password; logon denied


경고: 이제는 ORACLE에 연결되어 있지 않습니다.
SQL> conn HR/HR
ERROR:
ORA-01017: invalid username/password; logon denied

- 위 사용자의 잠긴권한은 풀었으나 패스워드가 없어서..
- 패스워드 생성... 아래..내용.
*alter user user명
[identified by 비번]
[account unlock]

SQL> edit
file afiedt.buf(이)가 기록되었습니다

  1  alter user hr
  2  identified by hr
  3* account unlock
SQL>
SQL> /

SQL> conn hr/hr
연결되었습니다.
SQL> show user
USER은 "HR"입니다

*.사용자가 권한 가진 테이블 : select * from tab;
SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
COUNTRIES                      TABLE
DEPARTMENTS                    TABLE
EMPLOYEES                      TABLE
EMP_DETAILS_VIEW               VIEW
JOBS                           TABLE
JOB_HISTORY                    TABLE
LOCATIONS                      TABLE
REGIONS                        TABLE

8 개의 행이 선택되었습니다.

*.table 구조 조회
desc[ribe] 테이블명

*.table 내용조회
select from table명

*.table너비 사이즈 조절
set linesize 사이즈

*.table높이 사이즈 조절 : 기본은 14.
set pagesize 사이즈

*.버퍼에 남은 명령어 실행
"/"

*.null : 입력당시값을 입력받지 못하면 null로 받음.

*.기본키(primary key)/외래키(foreign key)
emp 테이블의 기본키 -> empno
dept 테이블의 기본키 -> deptno
emp 테이블의 외리키 -> deptno
select * from emp;


Posted by 말없제이
,

orcle, 9i .. cd3장으로 구성

## 오라클 설치
이름 OraHome92
경로 c:\oracle\ora92
Enterprise Edition
일반적인 목적(javaw 차단해제)
포트번호 : 1521
전역데이터베이스 이름 : 예)ORCL
비밀번호 : 예)test (apache 차단해제)

## 오라클 삭제
1.오라클 설치제품 모두 해제
2.관리도구-서비스-오라클 관련 서비스 중지
3.시작-실행-regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service\EventLog\Aplication\
오라클로 시작되는 폴더 삭제
HKEY_LOCAL_MACHINE\SOFTWARE\ORCALE 폴더 삭제
(참고) ODBC폴더가 여기에 존재, 오라클 메뉴얼에는 이 ODBC폴더 삭제권고.(현재는 삭제안함)
4.(안전모드 부팅후) C:\ORCALE폴더삭제
5.정상부팅후 시작의 오라클 관련 메뉴 삭제
6.첫번째 디스크 놓고 재설치
6-1.경우에 따라 오라클이 설치완료되었다는 메시지가 바로
나타나는 경우 1번만 다시 실행하고
현재 창을 닫고 오라클설치프로그램 재시동.

## 오라클 설치확인
1.관리도구-서비스-오라클 관련 서비스 시작
2.시작-실행-cmd-sqlplus


Query :
DML : select,insert, delete, update
DDL 데이터 정의어 : Create, drop, alter
TCL 트랜젝션 컨트롤 언어

모델링 : table 관계구성도.

JavaScript : 유효성검사/필수입력. 동적효과
JavaServerPage/Servlet

서비스 - 확인

사용자 삽입 이미지

Posted by 말없제이
,