--
--作成者      :jeon.eunsu
--作成日      :2006/02/08 (水) 19:06:59
--対象DBMS    :Oracle 10g
--

-- 
-- TABLE: TUSER
--

DROP TABLE TUSER;

CREATE TABLE TUSER(
    USER_CODE        CHAR(8)         NOT NULL,
    USER_NAME        VARCHAR2(30)    NOT NULL,
    USER_PASSWORD    VARCHAR2(16)    NOT NULL,
    USER_DIVISION    CHAR(1)         NOT NULL
)
;


-- 
-- TABLE: ADDRESS 
--
DROP TABLE ADDRESS;

CREATE TABLE ADDRESS(
    CUSTOMER_CODE        CHAR(8)         NOT NULL,
    CUSTOMER_NAME   VARCHAR2(30)         NOT NULL,
    POST_CODE    	 CHAR(8)         NOT NULL,
    CUSTOMER_ADDRESS VARCHAR2(50)	 NOT NULL,
    CUSTOMER_TEL        CHAR(13)         NOT NULL
)
;


-- 
-- TABLE: TUSER
--

ALTER TABLE TUSER ADD 
    CONSTRAINT FUNC_THIN_PK1 PRIMARY KEY (USER_CODE)
;


-- 
-- TABLE: ADDRESS
--

ALTER TABLE ADDRESS ADD 
    CONSTRAINT FUNC_THIN_PK2 PRIMARY KEY (CUSTOMER_CODE)
;



--
-- TABLE: MEMBER
--
DROP TABLE MEMBER;
CREATE TABLE MEMBER (
MEMBER_CODE CHAR(8) NOT NULL,
MEMBER_NAME VARCHAR(30) NOT NULL,
MEMBER_AGE VARCHAR(3), 
MEMBER_BIRTH CHAR(10));

ALTER TABLE MEMBER ADD 
    CONSTRAINT FUNC_THIN_PK3 PRIMARY KEY (MEMBER_CODE)
;




--
-- TABLE: MESSAGES
--
DROP TABLE MESSAGES;
CREATE TABLE MESSAGES
(
    MESSAGE_KEY VARCHAR2(100) NOT NULL,
    MESSAGE_VALUE VARCHAR(100)
);

ALTER TABLE MESSAGES ADD 
    CONSTRAINT FUNC_THIN_PK4 PRIMARY KEY (MESSAGE_KEY)
;

--
-- TABLE: CODELIST
--
DROP TABLE CODELIST;
CREATE TABLE CODELIST
(
    KEY VARCHAR2(100) NOT NULL,
    VALUE VARCHAR(100)
);

ALTER TABLE CODELIST ADD 
    CONSTRAINT FUNC_THIN_PK5 PRIMARY KEY (KEY)
;

--
-- TABLE: TUPDOWNLOAD
--
DROP TABLE TUPDOWNLOAD;
CREATE TABLE TUPDOWNLOAD
(
    FILEID                         VARCHAR2(20) NOT NULL,
    FILENAME                       VARCHAR2(80) NOT NULL,
    FILEPATH                       VARCHAR2(200) NOT NULL,
    FILESIZE                       VARCHAR2(20) NOT NULL,
    CREATTIME                      DATE,
    UPDATETIME                     DATE,
    UPDATEUSER                     VARCHAR2(20)
);

-- 
-- TABLE: DBMESSAGES
--
DROP TABLE DBMESSAGES;
CREATE TABLE DBMESSAGES (
       ID             NUMBER(4)  NOT NULL,
       CODE           VARCHAR(32)  NOT NULL,
       LANGUAGES      VARCHAR(32),
       CONTRY         VARCHAR(32),
       VARIANT        VARCHAR(32),   
       MESSAGE        VARCHAR(256)
);

ALTER TABLE DBMESSAGES ADD 
    CONSTRAINT FUNC_RICH_PK1 PRIMARY KEY (ID)
;


COMMIT;