当前位置:网站首页>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);边栏推荐
猜你喜欢

Mysql基础篇(约束)

The difference between scheduleWithFixedDelay and scheduleAtFixedRate
![[kali-information collection] enumeration - DNS enumeration: DNSenum, fierce](/img/97/bbe7c2af0ff8bcb5222b9105d80c73.png)
[kali-information collection] enumeration - DNS enumeration: DNSenum, fierce

开源许可证 GPL、BSD、MIT、Mozilla、Apache和LGPL的区别

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

故乡的素描画

怀念故乡的面条

今日睡眠质量记录68分

「以云为核,无感极速」顶象第五代验证码

高数 | 【重积分】线面积分880例题
随机推荐
56:第五章:开发admin管理服务:9:开发【文件上传到,MongoDB的GridFS中,接口】;(把文件上传到GridFS的SOP)
「以云为核,无感极速」顶象第五代验证码
【无标题】
Unity's primary method for implementing PlanarReflection under the BuildIn rendering pipeline
Message queue MySQL table for storing message data
力扣(LeetCode)212. 单词搜索 II(2022.07.31)
lambda
Dry goods!How to Construct SRv6-TE Performance Test Environment Using Instrumentation
开源许可证 GPL、BSD、MIT、Mozilla、Apache和LGPL的区别
时时刻刻保持敬畏之心
RSA主要攻击方法
剑指 Offer 68 - I. 二叉搜索树的最近公共祖先
Difference Between Compiled and Interpreted Languages
Visual Studio提供的 Command Prompt 到底有啥用
高数 | 【重积分】线面积分880例题
一个往年的朋友
今日睡眠质量记录68分
typescript23-tuple
In the shake database, I want to synchronize the data of the source db0 to the destination db5, how to set the parameters?
Typescript22 - interface inheritance