写一段SQL增删改查的代码
时间: 2023-02-22 13:58:33 浏览: 39
增删查改代码.sql
假设我们有一张名为 "users" 的表,包含 "id", "username", "email" 和 "age" 四个字段:
增加记录:
```
INSERT INTO users (username, email, age)
VALUES ('John Doe', 'johndoe@example.com', 30);
```
修改记录:
```
UPDATE users
SET email = 'newemail@example.com'
WHERE id = 1;
```
查询记录:
```
SELECT * FROM users;
```
删除记录:
```
DELETE FROM users
WHERE id = 1;
```
阅读全文