
CREATE TABLE AUTO_NUMBER
(
    TABLE_NAME VARCHAR ,
    NEXT_NUMBER Integer NOT NULL ,

primary key(
    TABLE_NAME 
)
);
CREATE TABLE MESSAGE
(
    ID Integer ,
    USER_NAME VARCHAR (128) ,
    SUBJECT VARCHAR (128) ,
    CONTENTS VARCHAR (255) ,

primary key(
    ID 
)
);
CREATE TABLE ROLE
(
    ID Integer ,
    NAME VARCHAR NOT NULL ,

primary key(
    ID 
)
);
CREATE TABLE USER
(
    ID Integer ,
    NAME VARCHAR NOT NULL ,
    PASSWORD VARCHAR NOT NULL ,
    ROLE_ID Integer NOT NULL ,

primary key(
    ID 
)
);




alter table USER add constraint fk_USER_ROLE_ID foreign key (ROLE_ID) references ROLE (ID);


