This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [스키마.]테이블명( | |
컬럼1 컬럼1_데이터타입 [NULL, NOT NULL], | |
컬럼2 컬럼2_데이터타입 [NULL, NOT NULL], | |
… | |
)[TABLESPACE 테이블스페이스명]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE EMPLOYEES( | |
EMPLOYEE_ID NUMBER(6,0) NOT NULL, | |
EMP_NAME VARCHAR2(80) NOT NULL, | |
… | |
SALARY NUMBER(8,2), | |
HIRE_DATE DATE NOT NULL, | |
… | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE EX2_6( | |
COL_NULL VARCHAR2(10), | |
COL_NOT_NULL VARCHAR2(10) NOT NULL | |
); | |
INSERT INTO EX2_6 VALUES ('AA', ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO EX2_6 VALUES ('AA', 'BB'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CONSTRAINT_NAME, CONSTRAINT_TYPE, TABLE_NAME, SEARCH_CONDITION | |
FROM USER_CONSTRAINTS | |
WHERE TABLE_NAME = 'EX2_6'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE EX2_7( | |
COL_UNIQUE_NULL VARCHAR2(10) UNIQUE, | |
COL_UNIQUE_NNULL VARCHAR2(10) UNIQUE NOT NULL, | |
COL_UNIQUE VARCHAR2(10), | |
CONSTRAINTS UNIQUE_NM1 UNIQUE(COL_UNIQUE) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE EX2_8( | |
COL1 VARCHAR2(10) PRIMARY KEY, | |
COL2 VARCHAR2(10) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE EX2_9( | |
NUM1 NUMBER CONSTRAINTS CHECK1 CHECK (NUM1 BETWEEN 1 AND 9), | |
GENDER VARCHAR2(10) CONSTRAINTS CHECK2 CHECK (GENDER IN ('MALE', 'FEMALE')) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE EX2_10( | |
COL1 VARCHAR2(10) NOT NULL, | |
COL2 VARCHAR2(10) NULL, | |
CREATE_DATE DATE DEFAULT SYSDATE | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE [스키마.] 테이블명 [CASCADE CONSTRAINTS] |
OlderNewer