我的SQL代码有什么问题?它显示错误代码1064

时间:2018-09-22 18:31:28

标签: mysql sql

我试图找到问题所在。但不幸的是我不能。错误在INSERT TABLE行中显示为=您的SQL语法有错误;请查看与您的MySQL服务器版本相对应的手册,以获取正确的语法,以在第1行附近的“附近使用”,并在第21行的“ Course_Credit”列中将数据截断。TIA。

CREATE DATABASE testDB;

USE testDB;

CREATE TABLE COURSE (
    COURSE_ID VARCHAR(255),
    COURSE_TITLE VARCHAR(255),
    COURSE_CREDIT DOUBLE(255, 2)
);

INSERT INTO COURSE (COURSE_ID, COURSE_TITLE, COURSE_CREDIT)
VALUES ('CSE-101', 'Introduction to Computer Systems', '1.00'),
       ('CSE-102', 'Introduction to Computer Systems (Sessional)', '1.50'),
       ('EEE-105', 'Introduction to Electrical Engineering', '2.00'),
       ('EEE-106', 'Introduction to Electrical Engineering (Sessional)', '1.50'),
       ('ME-100', 'Mechanical Engineering Drawing-I', '1.50'),
       ('ME-101', 'Mechanical Engineering', '2.00'),
       ('ME-102', 'Mechanical Engineering (Sessional)', '1.50'),
       ('MATH-101', 'Differential Calculas And Co-ordinate Geometry', '3.00'),
       ('PHY-101', 'Physics', '3.00'),
       ('PHY-102', 'Physics (Sessional)', '1.50'),
       ('CSE-201', 'Structured Programming Language', '3.00'),
       ('CSE-202', 'Structured Programming Language (Sessional)', '1.50'),
       ('CSE-203', 'Discrete Mathematics', '3.00'),
       ('MATH-201', 'Integral Calculus, Differential Equations and Series', '3.00'),
       ('CHEM-201', 'Chemistry', '3.00'),
       ('CHEM-202', 'Chemistry (Sessional)', '1.50'),
       ('ENG-201', 'English', '2.00'),
       ('ENG-202', 'Communication in English (Practice)', '1.00'),
       ('SS-201', 'Government and Public Administration', '2.00'),
       ('CSE-301', 'Object Oriented Programming Language', '3.00'),
       ('CSE-302', 'Object Oriented Programming Language (Sessional)', '1,50'),
       ('CSE-303', 'Data Structures', '3.00'),
       ('CSE-304', 'Data Structures', '1.50'),
       ('MATH-301', 'Complex Variable and Statistics', '3.00');

1 个答案:

答案 0 :(得分:3)

在第21行的COURSE_CREDIT列的值内有一个逗号(“,”): ('CSE-302','面向对象的编程语言(会话),'1,50')

将值更改为1.50 ....应该可以使用

相关问题