TEAM이라는 테이블 생성한다.
TEAM_ID는 PK 제약조건을 둔다.
STADIUM_ID는 외래키 조건을 둔다.
create table team(
team_id char(3) not null,
region_name varchar(8) not null,
team_name varchar2(40) not null,
e_team_name varchar2(50),
orig_yyyy char(4),
stadium_id char(3) not null,
zip_code1 char(3),
zip_code2 char(3),
address varchar2(80),
ddd varchar2(3),
tel varchar2(10),
fax varchar2(10),
homepage varchar2(50),
owner varchar2(10),
constraint team_pk primary key (team_id)
);
desc team;
[결과]
이름 널 유형
----------- -------- ------------
TEAM_ID NOT NULL CHAR(3)
REGION_NAME NOT NULL VARCHAR2(8)
TEAM_NAME NOT NULL VARCHAR2(40)
E_TEAM_NAME VARCHAR2(50)
ORIG_YYYY CHAR(4)
STADIUM_ID NOT NULL CHAR(3)
ZIP_CODE1 CHAR(3)
ZIP_CODE2 CHAR(3)
ADDRESS VARCHAR2(80)
DDD VARCHAR2(3)
TEL VARCHAR2(10)
FAX VARCHAR2(10)
HOMEPAGE VARCHAR2(50)
OWNER VARCHAR2(10)