티스토리 뷰
CREATE TABLE
[ database_name.[ owner ] . | owner. ] table_name
( { < column_definition >
| column_name AS computed_column_expression
| < table_constraint > ::= [ CONSTRAINT constraint_name ] }
| [ { PRIMARY KEY | UNIQUE } [ ,...n ]
)
[ ON { filegroup | DEFAULT } ]
[ TEXTIMAGE_ON { filegroup | DEFAULT } ]
< column_definition > ::= { column_name data_type }
[ COLLATE < collation_name > ]
[ [ DEFAULT constant_expression ]
| [ IDENTITY [ ( seed , increment ) [ NOT FOR REPLICATION ] ] ]
]
[ ROWGUIDCOL ]
[ < column_constraint > ] [ ...n ]
< column_constraint > ::= [ CONSTRAINT constraint_name ]
{ [ NULL | NOT NULL ]
| [ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED ]
[WITH FILLFACTOR = fillfactor]
[ON {filegroup | DEFAULT} ] ]
]
| [ [ FOREIGN KEY ]
REFERENCES ref_table [ ( ref_column ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[ NOT FOR REPLICATION ]
]
| CHECK [ NOT FOR REPLICATION ]
( logical_expression )
}
< table_constraint > ::= [ CONSTRAINT constraint_name ]
{ [ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED ]
{ ( column [ ASC | DESC ] [ ,...n ] ) }
[WITH FILLFACTOR = fillfactor]
[ ON { filegroup | DEFAULT } ]
]
| FOREIGN KEY
[ ( column [ ,...n ] ) ]
REFERENCES ref_table [ ( ref_column [ ,...n ] ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[ NOT FOR REPLICATION ]
| CHECK [ NOT FOR REPLICATION ]
( search_conditions )
}
------------------------------------------------------------------------------------
알아보기 어렵잖아..
CREATE TABLE [IF NOT EXISTS] table_reference( column_name data type [dimensions] [DESCRIPTION column description] [NULLABLE][NOT NULL] [DEFAULT default value] [MIN | MINIMUM minimum value] [MAX | MAXIMUM maximum value] [CHARCASE UPPER | LOWER | NOCHANGE] [COMPRESS 0..9] [, column_name...] [, [CONSTRAINT constraint_name] [UNIQUE] [NOCASE] PRIMARY KEY (column_name [[ASC |ASCENDING] | [DESC | DESCENDING]] [, column_name...]) [COMPRESS DUPBYTE | TRAILBYTE | FULL | NONE]] [NOKEYSTATS] [TEXT INDEX (column_name, [column_name])] [STOP WORDS space-separated list of words] [SPACE CHARS list of characters] [INCLUDE CHARS list of characters] [DESCRIPTION table_description] [INDEX PAGE SIZE index_page_size] [BLOB BLOCK SIZE BLOB_block_size] [LOCALE locale_name | LOCALE CODE locale_code] [ENCRYPTED WITH password] [USER MAJOR VERSION user-defined_major_version] [USER MINOR VERSION user-defined_minor_version] [LAST AUTOINC last_autoinc_value] )
'IT 관련 > 데이터베이스' 카테고리의 다른 글
조작어 / 정의어 / 질의어 (0) | 2009.03.14 |
---|---|
레코드 삭제 DELETE (Transact-SQL Reference) (0) | 2009.03.14 |
테이블 수정 ALTER TABLE (0) | 2009.03.14 |
SQL의 자료형 (T-SQL / MYSQL) (0) | 2009.03.14 |
데이터베이스 생성 / 수정 / 삭제 (0) | 2009.03.14 |
- Total
- Today
- Yesterday
- 진례
- html tag
- 윈도우7
- 창원
- 인터넷 속도
- 일식
- 마산
- 버그가많아
- 플스
- MySQL
- 원어데이
- 짬뽕
- Flash
- 먹는게 남는다
- 그리스몽키
- 불여우
- 횟집
- Mac
- SQL
- Firefox
- java
- 김해
- react
- code
- 지름신
- ubuntu
- 아이폰
- Linux
- window7
- 파이어폭스
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |