我不确定如何将TXT文件作为表格导入或如何:
CustomerPk
设置为自动递增 CustNo
更改为索引并设置为必填这是我从我的老师那里获得的TXT文件,任何帮助将不胜感激。我试图只是将文件加载为CSV文件,但是表未正确显示。
CREATE TABLE customer
( CustomerPK INT(11)
CustNo CHAR(8),
CustFirstName VARCHAR(20),
CustLastName VARCHAR(30),
CustStreet VARCHAR(50),
CustCity VARCHAR(30),
CustState CHAR(2),
CustZip CHAR(10),
CustBal DECIMAL(12,2) DEFAULT 0,
CONSTRAINT CustomerPK PRIMARY KEY (CustNo)
)
注释:
使用以下SQL语句导入数据:
INSERT INTO customer
(CustNo, CustFirstName, CustLastName, CustStreet, CustCity,
CustState, CustZip, CustBal)
VALUES('C0954327','Sheri','Gordon','336 Hill St.','Littleton','CO','80129-5543',230.00);
INSERT INTO customer
(CustNo, CustFirstName, CustLastName, CustStreet, CustCity,
CustState, CustZip, CustBal)
VALUES('C1010398','Jim','Glussman','1432 E. Ravenna','Denver','CO','80111-0033',200.00);
INSERT INTO customer
(CustNo, CustFirstName, CustLastName, CustStreet, CustCity,
CustState, CustZip, CustBal)
VALUES('C2388597','Beth','Taylor','2396 Rafter Rd','Seattle','WA','98103-1121',500.00);
INSERT INTO customer
(CustNo, CustFirstName, CustLastName, CustStreet, CustCity,
CustState, CustZip, CustBal)
VALUES('C3340959','Betty','Wise','4334 153rd NW','Seattle','WA','98178-3311',200.00);
INSERT INTO customer
(CustNo, CustFirstName, CustLastName, CustStreet, CustCity,
CustState, CustZip, CustBal)
VALUES('C3499503','Bob','Mann','1190 Lorraine Cir.','Monroe','WA','98013-1095',0.00);