当前位置:网站首页>MySQL Practice Summary -
MySQL Practice Summary -
2022-08-01 04:48:00 【LXMXHJ】
Article table of contents
Case 1:
Known Information
Employee Table Employee
| Name | Type | Description |
|---|---|---|
| EmployeeId | Int | Employee id (unique) |
| Name | Varchar(50) | Employee Name |
| Age | Int | Employee Age |
| Varchar(50) | Staff Email | |
| Level | Int | Employee Level |
Salary salary
| Name | Type | Description |
|---|---|---|
| SalaryId | Int | salary id (unique) |
| EmployeeId | Int | employee id |
| Money | Double | Wage Amount |
| Date | Datetime | release date |
Questions and Answers
Query the names and email addresses of occasional employees, and sort by age in descending order and name in ascending order.
select Name,Emailfrom Employeeorder by Age asc,Name desc;Query the names of all employees with employee level 1 and the sum of their corresponding salary amounts.
①select e.Name,s.Moneyfrom Employee einner join Salary son e.EmployeeId = s.EmployeeIdwhere e.Level = 1Query all salary payment information higher than average salary and corresponding employee information (payment date, salary amount, employee id, employee name, employee age, employee email, employee level)
select s.Date,s.Money,s.EmployeeId,e.Name,e,Age,e.Email,e.Levelfrom Employee einner join Salary son e.EmployeeId = s.EmployeeIdwhere s.Money >(select avg(Money)from Salary);边栏推荐
- 「以云为核,无感极速」顶象第五代验证码
- 故乡的素描画
- PAT乙级 1002 写出这个数
- 基于ProXmoX VE的虚拟化家庭服务器(篇一)—ProXmoX VE 安装及基础配置
- The Flow Of Percona Toolkit pt-table-checksum
- typescript25 - type assertion
- 万字逐行解析与实现Transformer,并进行德译英实战(三)
- 【愚公系列】2022年07月 Go教学课程 023-Go容器之列表
- In the shake database, I want to synchronize the data of the source db0 to the destination db5, how to set the parameters?
- 请问表格储存中用sql只能查询到主键列,ots sql非主键不支持吗?
猜你喜欢

基于Arduino制作非接触式测温仪

剑指 Offer 68 - I. 二叉搜索树的最近公共祖先

mysql中解决存储过程表名通过变量传递的方法

智芯传感输液泵压力传感器 为精准智能控制注入科技“强心剂”

干货!如何使用仪表构造SRv6-TE性能测试环境

C# | 使用Json序列化对象时忽略只读的属性

MySQL-DML语言-数据库操作语言-insert-update-delete-truncate

Interview Blitz 69: Is TCP Reliable?Why?

Mysql基础篇(Mysql数据类型)

typescript28 - value of enumeration type and data enumeration
随机推荐
力扣(LeetCode)212. 单词搜索 II(2022.07.31)
UE4 从鼠标位置射出射线检测
UE4 制作遇到的问题
最新 955 不加班的公司名单
MySQL3
Li Chi's work and life summary in July 2022
TIM登陆时提示00001(TIM00001)
typescript25 - type assertion
Immutable
Mysql基础篇(约束)
PAT乙级 1001 害死人不偿命的(3n+1)猜想
Difference Between Compiled and Interpreted Languages
Mysql基础篇(Mysql数据类型)
Dry goods!How to Construct SRv6-TE Performance Test Environment Using Instrumentation
Step by step hand tearing carousel Figure 3 (nanny level tutorial)
scheduleWithFixedDelay和scheduleAtFixedRate的区别
typescript22-接口继承
请问表格储存中用sql只能查询到主键列,ots sql非主键不支持吗?
【愚公系列】2022年07月 .NET架构班 085-微服务专题 Abp vNext微服务网关
typescript27-枚举类型呢