有人可以告诉我我在做什么错在这里它必须是简单的东西首先我创建了一些带有外键的表,然后尝试从文本文件导入数据,并有各种无需所以现在我试图刚刚创建表加载数据,然后添加外键希望的工作,但它不是任何以往获取数据的错误继承人我做了什么从文本文件加载数据到数据库中的表格
create table Books (
ISBN Char(10) not null,
Title Varchar(50) not null,
Price Decimal(5,2) null,
Authors Varchar(50) null,
Pages int null,
PubYear int null,
QTY int null,
Constraint Books_PK primary key(ISBN)
);
create table customers (
customerid int not null,
company varchar(30) null,
firstname varchar(30) null,
lastname varchar(30) null,
street varchar(50) null,
city varchar(30) null,
state char(2) null default 'NE',
zip char(5) null,
phone char(10) null,
constraint customer_pk primary key(customerid)
);
create table orders (
orderid int not null,
customerid int not null,
orderdate date null,
shipdate date null,
shipping decimal(5,2) null,
salestax decimal(5,2) null,
constraint order_pk primary key(orderid)
);
create table orderinfo (
orderid int not null,
isbn char(10) not null,
qty int not null,
price decimal(5,2) not null,
detailid int not null auto_increment,
constraint orderinfo_pk primary key(detailid)
);
load data infile 'C:/lab8/books.txt
into table books;
它给了我一个错误说DATA TOO LONG FOR COLUMN ISBN IN ROW 1
文本文件的内容是
0929306279, Bell labs, 29.95, Gehani, 269, 2008, 121
0929306260, Java, 49.95, Sahni & Kumar, 465, 2008, 35
0670031844, White Mughals, 34.95, Dalrymple, 459, 2008, 78
0439357624, Born Confused, 16.95, Hidier, 432, 2007, 11
显然国际标准书号是10个字符,所以为什么它不会进入表格?
它的工作原理我使用MySQL 5.1 – feeela