출처: https://bumcrush.tistory.com/182 [맑음때때로 여름]
create table phoneInfo_basic (
        idx             number(6)       primary key,
        fr_name         varchar2(20)    not null,
        fr_phonenumber  varchar2(20)    not null,
        fr_email        varchar2(20)    default '-',
        fr_address      varchar2(20)    default '-',
        fr_regdate      DATE            default sysdate
);

create table phoneInfo_univ (
        idx             number(6)       primary key,
        fr_u_major      varchar2(20)    default 'N',
        fr_u_year       number(1)       check (5>=fr_u_year AND fr_u_year>=1),
        fr_ref          number(7)       references phoneinfo_basic(idx)
);


create table phoneinfo_com(
        idx             number(6)       primary key,
        fr_c_company    varchar2(20)    default 'N',
        fr_ref          number(6)       references phoneinfo_basic(idx)
);



-----------------------------------------------------------------------------------

create table fr_type(
    friendty      varchar2(5)    unique
);

insert into fr_type values ('univ');
insert into fr_type values ('com');
insert into fr_type values ('cafe');


-----------------------------------------------------------

create table phonebook(
    pidx            number(6)        primary key,
    friendtype      varchar2(5)      references fr_type(friendty)
);

----------------------------------------------------------------------------

'memo' 카테고리의 다른 글

[스프링] mvc패턴에 관한 블로그  (0) 2021.01.08
tomcat서버 에러 발생시 해결 방법  (0) 2020.12.28
Server Tomcat v8.5 Server at localhost failed to start  (0) 2020.12.23
이클립스(Eclipse) 개발환경 / uft-8  (0) 2020.11.02
있는 txt 뒤에 이어쓰기  (0) 2020.10.31
url  (0) 2020.10.28
java.net.BindException:  (0) 2020.10.28

+ Recent posts