数据库管理1

本文演示了使用SQL进行表创建、数据插入、更新、查询及删除等基本操作,并通过具体例子展示了如何筛选特定条件的数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

create table stu(
 `id` int(2) PRIMARY key auto_increment,
 `name` varchar(20),
 `sex` int(2),
 `phone` varchar(11),
 `role` int(2),
 `score` int(2)
)
INSERT into stu(id,`name`,sex,phone,role,score) VALUES (DEFAULT,'zhangsan',2,'13837689458',1,54);
INSERT into stu(id,`name`,sex,phone,role,score) VALUES (DEFAULT,'lisi',2,'18537689458',2,90);
INSERT into stu(id,`name`,sex,phone,role,score) VALUES (DEFAULT,'wangwu',1,'15937689458',3,94);
INSERT into stu(id,`name`,sex,phone,role,score) VALUES (DEFAULT,'zhaoliu',2,'13037689458',3,82);
UPDATE stu set phone='13297973866' where `name`='lisi';
SELECT * from stu where score<60;
SELECT * from stu where `name` like 'z%';
SELECT * from stu where role in (1,3);
DELETE from stu where role=1;
DELETE from stu;
TRUNCATE stu;
 

转载于:https://www.cnblogs.com/Zhangchuanfeng1/p/10615692.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值