用于练习 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;
始终指定要插入的列名:
INSERT INTO test_items(first_name, last_name)
VALUES ('Javier','Droid'), ('Gret','Jun'), ('Kilot','Ramirez');
SELECT * FROM test_items;