我尝试使用外键约束创建一个新表(tableB)到另一个表(tableA),只是想知道我是否可以创建所需的所有约束和索引.我的目标是有一个单独的create table声明,alter table…之后不需要声明,也没有其他create index…声明.这可能吗?感谢您提前提示:)
create table tableA
(
id number
, constraint tableApk primary key (id)
);
create table tableB
(
id number
, constraint tableBfk foreign key (id) references tableA (id)
on delete cascade
using index (
create index tableBfkidx on tableB (id)
)
);
Run Code Online (Sandbox Code Playgroud)