【MySQL】表的增删查改
增加(Create):
CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
email VARCHAR(100)
);
删除(Delete):
DROP TABLE IF EXISTS users;
查询(Read):
SELECT * FROM users;
更新(Update):
UPDATE users SET username='new_username' WHERE id=1;
插入(Create):
INSERT INTO users (username, password, email) VALUES ('user', 'pass', 'user@example.com');
删除记录:
DELETE FROM users WHERE id=1;
评论已关闭