mysql 插入语句

时间:2021-12-05 03:25:39

#插入语句,列数和值的个数必须一致

INSERT INTO beauty (id,NAME,sex,borndate,phone,photo,boyfriend_id)
VALUES (13,‘唐艺昕‘,‘女‘,‘1990-4-23‘,‘1898888888‘,NULL,2);

SELECT * FROM beauty;

INSERT INTO beauty (id,NAME,sex,borndate,phone,boyfriend_id)
VALUES (14,‘金星‘,‘女‘,‘1990-4-23‘,‘1388888888‘,2);

INSERT INTO beauty(id,NAME,sex,phone)
VALUES(15,‘娜扎‘,‘女‘,‘1377777777‘);

INSERT INTO beauty(NAME,sex,id,phone)
VALUES(‘蒋欣‘,‘女‘,17,‘110‘);

省略列名,默认所有列,而且列的顺序和表中列的顺序一致

INSERT INTO beauty
VALUE(18,‘张飞‘,‘男‘,NULL,‘119‘,NULL,NULL);