当前位置:网站首页>Getting Started Database Days4
Getting Started Database Days4
2022-08-01 21:47:00 【Xiao Wu has an idea】
- 学习视频【韩顺平讲MySQL】零基础一周学会MySQL -sql mysql教程 mysql视频 mysql入门_哔哩哔哩_bilibili
- 萌新入门,如有错误恳请各位大佬指点,不甚感激
目录
日期函数
例:返回当前日期
例:返回当前时间
例:返回当前时间戳
例:
Create a news sheett77
1:显示所有新闻信息,发布日期只显示 日期,不用显示时间
2:查询在10分钟内发布的新闻
3:请在mysql 的 sql语句中求出 2011-11-11 和 1990-01-01 相差多少天
4:请用mysql 的sqlstatement to find out how many days you have lived now
5:如果你能活80岁,求出你还能活多少天
以上year,monthThe effect is to make it return only the year or month of the time
例:FROM_UNIXTIME() : 可以把一个unix_timestamp 秒数,转成指定格式的日期
意义:在开发中,可以存放一个整数,然后表示时间,通过FROM_UNIXTIME转换
加密函数
例:查询用户
例:查询当前使用数据库名称
例:MD5(str) 为字符串算出一个 MD5 32 的字符串,常用(用户密码) 加密
----root 密码是 hsp-> 加密md5 -> 在数据库中存放的是加密后的密码
The general query user is written as follows
PASSWORD(str) 加密函数,MysqlThe user password for the database is its encryption
例:
从原文密码str计算并返回 密码字符串
流程控制函数
IF(expr1,expr2,expr3) 如果expr1为true,则返回expr2,否则返回expr3
IFNULL(expr1,expr2) 如果expr1不为空 NULL,则返回expr1,否则返回expr2
例:先创建一个emp表
1.查询emp表,如果comn是null,则显示0.0
2.如果表的job是clerk,则显示职员,如果是manager,则显示经理,如果是SALESMAN则显示销售人员,Others display normally
查询增强
例:查询2000A monster who joins after a year
例:Display initials ass的员工姓名和工资
例:Displays the third character as r的所有员工的姓名和工资
例:查询表的结构
例:Displays employee information in order of salary from lowest to highest
例:按照部门号升序而雇员的工资降序排列,显示雇员信息
分页查询
SELECT * FROM t99
ORDER BY t99
LIMIT 每页显示记录数*(第几页-1),每页显示记录数
分组增强
例:
例:统计没有获得补助的雇员数
例:Displays the total number of administrators
错误写法:
这里有两个7698
正确写法:去重
例:Displays the maximum difference in wages
例:统计各个部门group by 的平均工资avg,并且是大于1000的having,并且按照平均工资从高到低排序,order by,取出前两行记录 limit 0, 2
以上为今天的视频笔记,如有侵权请联系我删除.
学习如逆水行舟,不进则退.和小吴一起加油吧!
边栏推荐
- Jmeter combat | Repeated and concurrently grabbing red envelopes with the same user
- RecycleView的使用
- Based on php hotel online reservation management system acquisition (php graduation project)
- 【C语言】猜数字小游戏
- shell programming conventions and variables
- ImportError: `save_weights` requires h5py.问题解决
- Transformer学习
- FusionGAN:A generative adversarial network for infrared and visible image fusion article study notes
- 365 days challenge LeetCode1000 questions - Day 046 Generate a string with odd number of each character + add two numbers + valid parentheses
- 易周金融分析 | 银行ATM机智能化改造提速;互联网贷款新规带来挑战
猜你喜欢
Recycling rental system 100% open source without encryption Mall + recycling + rental
WEB 渗透之文件类操作
shell specification and variables
_ _ determinant of a matrix is higher algebra eigenvalue of the product, the characteristic value of matrix trace is combined
可视化——Superset使用
【Jmeter常用断言组件】
一个关于操作数据库的建议—用户密码
2022-08-01 第五小组 顾祥全 学习笔记 day25-枚举与泛型
ModuleNotFoundError: No module named 'yaml'
还在纠结报表工具的选型么?来看看这个
随机推荐
找工作必备!如何让面试官对你刮目相看,建议收藏尝试!!
Spark集群搭建
今年的很美味
Transformer学习
不卷了!入职字节跳动一周就果断跑了。
基于php旅游网站管理系统获取(php毕业设计)
LVS负载均衡群集
SOM网络2: 代码的实现
图像融合GANMcC学习笔记
【Objective-C中的@synthesize】
入门数据库Days4
多商户商城系统功能拆解19讲-平台端发票管理
File operations of WEB penetration
二分法中等 LeetCode6133. 分组的最大数量
ARFoundation入门教程U2-AR场景截图截屏
【C语言实现】求两个整数的较大值
一个关于操作数据库的建议—用户密码
KMP 字符串匹配问题
你居然不懂Bitmap和Drawable? 相关知识大扫盲
安全第五次课后练习