MySQL表的操作『增删改查』
增(Create):
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
);
删(Delete):
DELETE FROM `user` WHERE `id` = 1;
改(Update):
UPDATE `user` SET `name` = 'New Name' WHERE `id` = 1;
查(Query):
SELECT * FROM `user`;
以上是MySQL表的基本增删改查操作示例。
评论已关闭