idea连接mysql以及数据表的增删改查

# 连接接数据库时区设置
# jdbc:mysql://10.10.10.172:3306/lms?&useLegacyDatetimeCode=false&serverTimezone=UTC

# 显示所有表数据
# show tables;

# 创建表
# create table if not exists `student_tbl`(
#     `sno` integer primary key ,
#     `sname` varchar(20) not null ,
#     `sage` integer not null ,
#     `saddress` varchar(30) not null
# )

# 删除表
# drop TABLE student_tbl;

# 插入表数据库
# insert into student_tbl
#         (sno,sname,sage,saddress)
#         values
#         (1,'美羊羊',10,'nj');

# 查询表数据
# select * from student_tbl;
# select sname,sage from student_tbl
# where sno =1;


# UPDATE 更新查询
# update student_tbl
# set  sage = 10
# where sno = "1";

# 删除表中的记录
# delete from student_tbl
# where sno=1;


# like 模糊查询
# select * from student_tbl where sname like '%喜%';
# '%a' 以a结尾
# 'a%' 以a开头
#'%a%' 包含a
# '_a_' 三位且中间字母是a
# '_a'  两位且结尾字母是a
# 'a_'  两位且开头字母是a



  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值