当前位置:网站首页>【头歌educoder数据表中数据的插入、修改和删除】
【头歌educoder数据表中数据的插入、修改和删除】
2022-07-06 09:22:00 【馥滢( '▿ ' )】
1、本关任务:在library数据库的reader数据表中插入一条数据
姓名xm为林团团,电话号码dhhm为13507311234,其余字段取默认值
显示数据表的所有数据
use library;
#代码开始
insert into reader (xm,dhhm) values('林团团',13507311234);
select * from reader;
#代码结束2、本关任务:
在reader数据表中插入一位读者
读者证号是2,姓名是陈洁,性别是女,身份是教研人员,电话号码是13319551234
提示:reader数据表各个字段顺序为dzzh,xm,xb,sf,dhhm
use library;
#代码开始
insert into reader (dzzh,xm,xb,sf,dhhm) values(2,'陈洁','女','教研人员',13319551234);
#代码结束
select * from reader;3、本关任务:在reader数据表中插入多条数据
姓名是黄小小,性别是男,身份是研究生,电话是13316789987
姓名是刘大任,性别是男,身份是工作人员,电话18012341234
姓名是邓朝阳,性别是女,身份是研究生,电话是17716554432
提示:数据表reader的姓名、性别、身份、电话号码字段是xm,xb,sf,dhhm
读者证号是自增字段,其值会自动产生
use library;
#代码开始
insert into reader (xm,xb,sf,dhhm) values('黄小小','男','研究生',13316789987);
insert into reader (xm,xb,sf,dhhm) values('刘大任','男','工作人员',18012341234);
insert into reader (xm,xb,sf,dhhm) values('邓朝阳','女','研究生',17716554432);
#代码结束
select * from reader;4、本关任务:将reader数据表中林团团xm的电话号码dhhm修改为17718991989
use library;
#代码开始
update reader set dhhm=17718991989 where xm='林团团';
#代码结束
select * from reader;5、本关任务:修改读者表reader的陈洁xm的电话号码dhhm为13315667745
身份为工作人员
use library;
#代码开始
update reader set dhhm=13315667745,sf='工作人员' where xm='陈洁';
#代码结束
select * from reader;6、本关任务:将每位读者reader的读者证dzzh号加十
use library;
#代码开始
update reader set dzzh=dzzh+10;
#代码结束
select * from reader;7、本关任务:删除读者reader数据表中的陈洁xm
use library;
#代码开始
delete from reader where xm='陈洁';
#代码结束
select * from reader;8、本关任务:删除读者reader中的所有研究生sf
use library;
#代码开始
delete from reader where sf='研究生';
#代码结束
select * from reader;9、本关任务:删除所有读者reader
use library;
#代码开始
Truncate reader;
#代码结束
select * from reader;边栏推荐
- Read only error handling
- 【九阳神功】2017复旦大学应用统计真题+解析
- [the Nine Yang Manual] 2017 Fudan University Applied Statistics real problem + analysis
- 简单理解ES6的Promise
- [the Nine Yang Manual] 2019 Fudan University Applied Statistics real problem + analysis
- 【九阳神功】2020复旦大学应用统计真题+解析
- Wechat applet
- C language Getting Started Guide
- Beautified table style
- Zatan 0516
猜你喜欢

深度强化文献阅读系列(一):Courier routing and assignment for food delivery service using reinforcement learning

3.输入和输出函数(printf、scanf、getchar和putchar)

A piece of music composed by buzzer (Chengdu)

仿牛客技术博客项目常见问题及解答(一)

Difference and understanding between detected and non detected anomalies

About the parental delegation mechanism and the process of class loading

C language to achieve mine sweeping game (full version)

Using spacedesk to realize any device in the LAN as a computer expansion screen

2.C语言初阶练习题(2)

FAQs and answers to the imitation Niuke technology blog project (II)
随机推荐
抽象类和接口的区别
4. Binary search
[the Nine Yang Manual] 2016 Fudan University Applied Statistics real problem + analysis
2.C语言矩阵乘法
6. Function recursion
PriorityQueue (large root heap / small root heap /topk problem)
[中国近代史] 第五章测验
【黑马早报】上海市监局回应钟薛高烧不化;麦趣尔承认两批次纯牛奶不合格;微信内测一个手机可注册俩号;度小满回应存款变理财产品...
2.初识C语言(2)
7-15 h0161. 求最大公约数和最小公倍数(PTA程序设计)
C语言入门指南
Miscellaneous talk on May 27
Why use redis
1. C language matrix addition and subtraction method
4.分支语句和循环语句
2022 Teddy cup data mining challenge question C idea and post game summary
撲克牌遊戲程序——人機對抗
这次,彻底搞清楚MySQL索引
(original) make an electronic clock with LCD1602 display to display the current time on the LCD. The display format is "hour: minute: Second: second". There are four function keys K1 ~ K4, and the fun
C语言入门指南