KHAcademyProject2020 / Spring-Project-Trip2Reap

국내 여행 사이트
Apache License 2.0
0 stars 0 forks source link

[이규호] SQL 쿼리문 수정 및 샘플데이터 추가 #5

Closed loveAlakazam closed 3 years ago

loveAlakazam commented 4 years ago

BOARD 테이블 컬럼 추가

--게시판 테이블
CREATE TABLE BOARD(
    BO_NO NUMBER(10) NOT NULL,
    CA_CODE NUMBER(5) NOT NULL,
    BO_TITLE VARCHAR2(300) NOT NULL,
    BO_CONTENT LONG NOT NULL,
    MEMBER_ID VARCHAR2(30) NOT NULL,
    BO_COUNT NUMBER(10) DEFAULT 0 NOT NULL,
    BO_TAG VARCHAR2(300),
    BO_DELETE_YN VARCHAR2(10) DEFAULT 'N' NOT NULL,

    PRIMARY KEY (BO_NO),
    FOREIGN KEY (CA_CODE) REFERENCES CATEGORY(CA_CODE),
    FOREIGN KEY (MEMBER_ID) REFERENCES MEMBER(MEMBER_ID),
    CHECK (CA_CODE BETWEEN 1 AND 5), --테이블 카테고리번호는 1,2,3,4,5 로 제한한다.
    CHECK (BO_DELETE_YN IN ('Y', 'N'))
);

ALTER TABLE BOARD ADD REGDATE DATE DEFAULT SYSDATE;


샘플데이터 추가

insert into BOARD values(2,3,'여행2','여행가고싶다2','ko1850',0,'#여행#여행','N',DEFAULT);
insert into BOARD values(3,3,'여행3','여행가고싶다3','ko1850',0,'#여행#여행','N',DEFAULT);
insert into BOARD values(4,3,'여행4','여행가고싶다4','ko1850',0,'#여행#여행','N',DEFAULT);
insert into BOARD values(5,3,'여행','여행가고싶다','ko1850',0,'#여행#여행','N',DEFAULT);
insert into BOARD values(6,3,'여행','여행가고싶다','ko1850',0,'#여행#여행','N',DEFAULT);
insert into BOARD values(7,3,'여행','여행가고싶다','ko1850',0,'#여행#여행','N',DEFAULT);
loveAlakazam commented 4 years ago

BOARD SEQUENCE (8번 부터 시작...)

규호(@ko1850 )씨가 작성한 샘플데이터 추가할 경우는 시퀀스를 아래와 같이해주세요!

CREATE SEQUENCE SEQ_BO_NO
START WITH 8
INCREMENT BY 1
MAXVALUE 9999999999
NOCYCLE
NOCACHE;