1.create table a( artist_id int constraint pk_id primary key,
name varchar2(10),sex varchar2(10),genre varchar2(10))
其他同理
2.不可以。一个表只可以一个主键,但可以使用组合主键。
3.
null,
primary key
unique key
foreign key
check
name varchar2(10),sex varchar2(10),genre varchar2(10))
其他同理
2.不可以。一个表只可以一个主键,但可以使用组合主键。
3.
null,
primary key
unique key
foreign key
check
实际上也没必要外键,只要简单用sql关联查询就可以了
select * from a,b,c where a.artist_ID=c.artist_ID and b.record_ID=c.record_ID
请问你说的组合键是什么意思?
create table b
(record_ID int not null,
recordname varchar2(30) not null,
constraint pk_record_b primary key(record_ID,recordname))
兩個表之間的關系問題,不過外鍵在有的時候還是由必要的,它可以使數
據的一致性和完整性由很好的保証