我想一个表时连接2个外键
create table tb_lm(
lm_id number not null primary key,--类名的id
lm_name varchar2(20) not null,--类名的名字
lm_date date default sysdate --时间
)
--创建序列跟触发器
--序列
create sequence seq_tb_lm;
create trigger t_tb_lm
before insert
on tb_lm
for each row
begin
:new.lm_id:=seq_tb_lm.nextval;
end;
--插入数据
insert into tb_lm(lm_name)
select '首页' from dual union
select '图书' from dual union
select '百货' from dual union
select '数码' from dual union
select '品牌' from dual
select * from tb_lm
--创建小分类表名tb_xfl
create table tb_xfl(
xflid number not null ,
xfllmid number not null references tb_lm(lm_id),
xflname varchar2(20) not null,
xfldate date default sysdate
)
--创建序列和触发器
create sequence seq_tb_xfl;
create trigger t_tb_xfl
before insert
on tb_xfl
for each row
begin
:new.xflid:=seq_tb_xfl.nextval;
end;
select * from tb_xfl
update tb_xfl set xfllmid=2,xflname='以纯' where xflid=4;
--创建商品表
create table tb_goods(
gs_id number not null,
gs_name varchar2(200) not null,
gs_flm number references tb_xfl (xfllmid),
gs_img varchar2(100) not null,
gs_price number(8,2) not null,
gs_kucun number,
gs_date date default sysdate
)
--创建序列和触发器
create sequence seq_goods;
create trigger t_tb_goods
before insert
on tb_goods
for each row
begin
:new.gsid:=seq_goods.nextval;
end;
可是报错,求大神帮忙解决,急