DROP TABLE IF EXISTS student;
CREATE TABLE student(
bannerid VARCHAR(9) PRIMARY KEY NOT NULL ,
lastname VARCHAR(45) NOT NULL ,
firstname VARCHAR(45) NOT NULL ,
major VARCHAR(45) NOT NULL DEFAULT 'undeclared' ,
gpa DECIMAL(2) NOT NULL DEFAULT 0.00 ,
age INT NOT NULL DEFAULT 18);
INSERT INTO student VALUES ('b00001111', 'smith', 'fred', 'computer science', 3.12, 20);
INSERT INTO student VALUES ('b00002222', 'jones', 'herb', 'computer science', 2.00, 19);
INSERT INTO student VALUES ('b00003333', 'chan', 'jackie', 'computer information systems', 3.50, 50);
INSERT INTO student VALUES ('b00004444', 'baker', 'al');
INSERT INTO student VALUES ('b00005555', 'booker', 'sue');
這會導致以下錯誤,我不明白爲什麼。我希望最後兩個INSERT使用默認值。MySQL錯誤1136:列計數與第1行的值計數不匹配
MySQL錯誤1136:列數並不在行1
插入學生VALUES('b00004444','麪包師','AL',主要,GPA,年齡); 插入學生VALUES('b00005555','booker','sue',major,gpa,age); – kmaz13 2012-03-21 04:04:47