create table <테이블이름>(<필드리스트>);
create table department (
dept_id varchar2(10) not null,
dept_name varchar2(14) not null,
office varchar2(10));
create table department (
dept_id varchar2(10) not null,
dept_name varchar2(14) not null,
office varchar2(10),
constraint pk_department primary key(dept_id));
create table student (
stu_id varchar2(10),
resident_id varchar2(14) not null,
name varchar2(10) not null,
year int,
address varchar2(10),
dept_id varcahr2(10),
constraint pk_student primary key(stu_id),
constraint fk_student foreign key(dept_id) references department(dept_id));
drop table <테이블이름>;
student
테이블이 department
를 외래키로 참조하고 있어 삭제할 수 없음alter table <테이블이름> add <추가할필드>
student
테이블에 age 추가
alter table <테이블 이름> drop column <삭제할 필드>;