Use bkstore;
Drop table if exists bk;
Drop table if exists mb;
Drop table if exists sel;
Create table bk (
书号 char(20) not null,
书名 varchar(40) not null,
单价 float(5) not null
);
Create table mb (
身份证号 char(18) not null,
会员密码 char(6) not null,
会员姓名 char(10) not null
);
Create table sel (
身份证号 char(18) not null,
书号 char(20) not null,
订购数量 int(5) not null,
订购单价 float(5) not null,
订购金额 float(5)
);把上面的文件保存为 table.sql
然后用 source table.sql 命令创建表
提示:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '份证
号 char(18) not null,这个错误,每个表都有这个错误,不解 刚刚解除这个 请教
Drop table if exists bk;
Drop table if exists mb;
Drop table if exists sel;
Create table bk (
书号 char(20) not null,
书名 varchar(40) not null,
单价 float(5) not null
);
Create table mb (
身份证号 char(18) not null,
会员密码 char(6) not null,
会员姓名 char(10) not null
);
Create table sel (
身份证号 char(18) not null,
书号 char(20) not null,
订购数量 int(5) not null,
订购单价 float(5) not null,
订购金额 float(5)
);把上面的文件保存为 table.sql
然后用 source table.sql 命令创建表
提示:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '份证
号 char(18) not null,这个错误,每个表都有这个错误,不解 刚刚解除这个 请教
[/align]
书号 char(20) not null,
书名 varchar(40) not null,
单价 float(5) not null
);ENGINE=MyISAM DEFAULT CHARSET=latin1;
Create table mb (
身份证号 char(18) not null,
会员密码 char(6) not null,
会员姓名 char(10) not null
);ENGINE=MyISAM DEFAULT CHARSET=latin1;
Create table sel (
身份证号 char(18) not null,
书号 char(20) not null,
订购数量 int(5) not null,
订购单价 float(5) not null,
订购金额 float(5)
);ENGINE=MyISAM DEFAULT CHARSET=latin1;
我是在命令行输入的
mysql>use tbl
Database changed
mysql>create table mytbl(
->qq Char(15),
->code Char(20),
->);
ERROR 1064(42000):You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version ofr the right syntax to use near ')'at
line 4
大虾们,这是啥子问题啊
->qq Char(15),
->code Char(20),
->);[align=center]==== 思想重于技巧 ====
[/align]
[/align]
在中文字段边上加上 键盘1边上的符号就OK了
单价 float(5) not null
改成
`单价` float(5) not nullenti