标题:MYSQl中定义外键出问题了
只看楼主
david168520
Rank: 2
来 自:湖北
等 级:论坛游民
帖 子:227
专家分:50
注 册:2009-2-16
结帖率:100%
已结贴  问题点数:20 回复次数:1 
MYSQl中定义外键出问题了
create database Loan;
use Loan;
create table student(number varchar(10) not null primary key,name varchar(10) not null,loanNumber varchar(10),
ID varchar(20) not null,sex varchar(5) not null,birthday varchar(50) not null,enterSchoolTime varchar(50) not null,address varchar(50),
postID varchar(10) not null,telNumber varchar(15),class varchar(50),academy varchar(50),major varchar(20),
loanType int,loanAmount int,loanState varchar(10))TYPE=INNODB;

create table loan(loanNumber varchar(10) ,name varchar(10) not null,number varchar(10) not null ,
applyLoanTime varchar(20) not null,
class varchar(50),academy varchar(50),major varchar(20),
loanType int,loanAmount int,loanState varchar(10),FOREIGN KEY (loanNumber,name,number,class,academy,major,loanType,loanAmount,loanState)
REFERENCES student(loanNumber,name,number,class,academy,major,loanType,loanAmount,loanState),primary key(number,loanNumber))TYPE=INNODB;
create unique index index_loan on loan(loanNumber,name,number,class,academy,major,loanType,loanAmount,loanState);
这是我定义的数据库表,及索引,但在MYSQL命令行中运行时候提示出错了: Can't create table '.\loan\#sql-39c_25.frm' (errno: 150),我在网上找了好久类似的问题方法一一试遍了就是解决不了希望各们高手们帮忙解答下,万分感谢了!
搜索更多相关主题的帖子: MYSQl 定义 
2009-07-26 23:24
mx250052
Rank: 2
等 级:论坛游民
帖 子:61
专家分:25
注 册:2009-3-1
得分:20 
哇哇哇哇,我我我!还是没学到这!嘿嘿,楼主加油!
2009-07-29 10:17



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-280638-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.276377 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved