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,
这个错误,每个表都有这个错误,不解   刚刚解除这个 请教

解决方案 »

  1.   

    SQL语句应该没有问题,分开执行,看看是哪段有问题
      

  2.   

    set name `gbk`;先设一下字符集, 强烈不建议用中文做字段名。[align=center]====  ====
    [/align]
      

  3.   

    Create table bk (
        书号 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;
      

  4.   

    我的情况不一样
    我是在命令行输入的
    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 
    大虾们,这是啥子问题啊
      

  5.   

    mysql>create table mytbl(
         ->qq Char(15),
         ->code Char(20),
         ->);[align=center]====  ====
    [/align]
      

  6.   

    多了个逗号, 为什么不自己开贴问?[align=center]====  ====
    [/align]
      

  7.   

    shi zheyang de   w问题已经解决了,是这样的
    在中文字段边上加上 键盘1边上的符号就OK了
       单价 float(5)     not null
    改成
       `单价` float(5)     not nullenti