0

练习 id 匹配的小桌子。

CREATE DATABASE test_1;
USE test_1;

CREATE TABLE test_items(

contact_id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR (20) ,
last_name VARCHAR (20),
PRIMARY KEY (contact_id)
);

INSERT INTO test_items()

VALUES (
(NULL, 'Javier','Droid'),
(NULL,'Gret','Jun'),
(null,'Kilot','Ramirez')

);
SELECT * FROM test_items;
4

1 回答 1

1

始终指定要插入的列名:

INSERT INTO test_items(first_name, last_name)  
VALUES ('Javier','Droid'), ('Gret','Jun'), ('Kilot','Ramirez'); 

SELECT * FROM test_items;
于 2019-04-25T15:31:48.210 回答