作者Howie0417 (猴子)
看板Database
标题[SQL ] foreign key 的问题...拜托各位帮忙一下@@
时间Sun Jan 10 00:55:17 2010
嗯这是我目前在作的一个报告
就是我已经先建立了下面这个table
create table customer
( customer_ID varchar(10) not null,
customer_姓名 varchar(10) not null,
customer_昵称 varchar(10) not null,
customer_电话 varchar(15) not null,
customer_手机 varchar(15) not null,
customer_地址 varchar(30) not null,
customer_生日 date not null,
customer_职业 varchar(15) not null,
年收入 varchar(15) not null,
特殊要求 varchar(100) not null,
primary key (customer_ID,customer_姓名));
create table record
( record_ID varchar(10) not null,
customer_ID varchar(10) not null,
lady_ID varchar(10) not null,
service_ID varchar(10) not null,
driver_ID varchar(10) not null,
地点 varchar(30) not null,
日期 date not null,
primary key (record_ID,customer_ID,lady_ID),
foreign key (customer_ID) references customer (customer_ID));
接下来我想要开始建立record的资料表的时候
他都会说找不到"主资料表之参照栏位中的唯一索引"
请问到底是怎麽一回事...
拜托帮帮我
我知道这是很初级的问题
但是我实在是卡在这边卡太久了还是没想到哪里出了错....
才想说来请教各位指点迷津
麻烦大家了....
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.4.186
1F:推 daniel1205:Customer 那个 Table要先有资料... (对应的 CustomerID 01/10 01:41
2F:→ Howie0417:可是我已经先建立好了customer的表格了阿@@ 01/11 01:09