Home > database >  The workbench to import 1064 errors in SQL file
The workbench to import 1064 errors in SQL file

Time:02-04

The code is as follows: the use student;

? The CREATE TABLE student (
Studentno VARCHAR (10) NOT NULL, PRIMARY KEY,
Studentname VARCHAR (20) NOT NULL,
Loginpwd VARCHAR (8) NOT NULL,
Sex CHAR (1),
Majorid INT the NOT NULL REFERENCES grade (majorid),
Phone VARCHAR (11),
Email VARCHAR (20),
Borndate DATETIME
);

The CREATE TABLE major (
Majorid INT the NOT NULL AUTO_INCREMENT PRIMARY KEY,
Majorname VARCHAR (20) NOT NULL

);
The CREATE TABLE result (
Id INT the NOT NULL AUTO_INCREMENT PRIMARY KEY,
Studentno VARCHAR (10) NOT NULL REFERENCES student (studentno),
Score DOUBLE
);


INSERT INTO major VALUES (NULL, 'javaee);
INSERT INTO major VALUES (NULL, 'it');
INSERT INTO major VALUES (NULL, 'android');


INSERT INTO student VALUES (' S001 ', 'zhang', '8888' and 'male', 1, '13288886666', '[email protected]', '1966-9-1');
INSERT INTO student VALUES (' S002 ', 'Yin was',' 8888 'and' male ', 1, '13888881234', '[email protected]', '1976-9-2');
INSERT INTO student VALUES (' S003 ', 'father', '8888' and 'male', 2, '13288886666', '[email protected]', '1986-9-3');
INSERT INTO student VALUES (' S004 ', 'Zhang Cuishan', '8888' and 'male', 1, '13288886666', NULL, '1995-9-4');
INSERT INTO student VALUES (' S005 ', 'little one', '8888', 'woman', 3, '13288885678', '[email protected]', '1990-9-5');

INSERT INTO student VALUES (' S006 ', 'zhang mowgli', '8888' and 'male', 2, '13288886666', '[email protected]', '1998-8-9');
INSERT INTO student VALUES (' S007 ', 'zhao', '0000', 'woman', 1, '13288880987', '[email protected]', '1998-6-9');
INSERT INTO student VALUES (' S008 ', 'week zhi if', '6666', 'woman', 1, '13288883456', '[email protected]', '1996-7-9');
INSERT INTO student VALUES (' S009 ', 'YanSuSu', '8888', 'woman', 1, '13288886666', '[email protected]', '1986-1-9');
INSERT INTO student VALUES (' S010 ', 'Song Yuan bridge', '6666' and 'male', 3, '1328888890', '[email protected]', '1996-2-9');


INSERT INTO student VALUES (' S011 ', 'Yang don't regret', '6666', 'woman', 2, '13288882345', NULL, '1995-9-9');
INSERT INTO student VALUES (' S012 ', 'Yang Xiao', '9999' and 'male', 1, '13288885432', NULL, '1976-9-9');
INSERT INTO student VALUES (' S013 ', 'JiXiao fu', '9999', 'woman', 3, '13288888765', NULL, '1976-9-9');
INSERT INTO student VALUES (' S014 ', 'thank sun', '9999' and 'male', 1, '13288882211', NULL, '1946-9-9');
INSERT INTO student VALUES (' S015 ', 'Song Qingshu', '9999' and 'male', 3, '13288889900', NULL, '1976-6-8');



INSERT INTO the result VALUES (NULL, 's001, 100);
INSERT INTO the result VALUES (NULL, 's002, 90);
INSERT INTO the result VALUES (NULL, 's003, 80);

INSERT INTO the result VALUES (NULL, 's004, 70);
INSERT INTO the result VALUES (NULL, 's005, 60).
INSERT INTO the result VALUES (NULL, 's006, 50);
INSERT INTO the result VALUES (NULL, 's006, 40);
INSERT INTO the result VALUES (NULL, 's005, 95);
INSERT INTO the result VALUES (NULL, 's006, 88);

CodePudding user response:

Excuse me, how should solve it thanks
  • Related