1.创建表A
CREATE TABLE A ( id NUMBER PRIMARY KEY, name VARCHAR2(50), age NUMBER);
2.创建表B
CREATE TABLE B ( id NUMBER PRIMARY KEY, a_id NUMBER, description VARCHAR2(100), CONSTRAINT fk_a_id FOREIGN KEY (a_id) REFERENCES A (id));
3.建立索引
CREATE INDEX idx_b_a_id ON B (a_id);