当前位置:网站首页>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 = 1
Query 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);
边栏推荐
猜你喜欢
typescript20-接口
A way to deal with infinite debugger
Risk strategy important steps of tuning method
最新 955 不加班的公司名单
Message Queuing Message Storage Design (Architecture Camp Module 8 Jobs)
MySQL-DML语言-数据库操作语言-insert-update-delete-truncate
API Design Notes: The pimpl trick
MySQL3
Visual Studio提供的 Command Prompt 到底有啥用
故乡的素描画
随机推荐
【愚公系列】2022年07月 .NET架构班 085-微服务专题 Abp vNext微服务网关
请问shake数据库中为什么读取100个collection 后,直接就退出了,不继续读了呢?
UE4 制作遇到的问题
Passive anti-islanding-UVP/OVP and UFP/OFP passive anti-islanding model simulation based on simulink
typescript21 - Comparison of Interfaces and Type Aliases
56:第五章:开发admin管理服务:9:开发【文件上传到,MongoDB的GridFS中,接口】;(把文件上传到GridFS的SOP)
MySQL3
Immutable
李迟2022年7月工作生活总结
How to promote new products online?
PMP 项目质量管理
How to write a high-quality digital good article recommendation
高数 | 【重积分】线面积分880例题
【kali-信息收集】枚举——DNS枚举:DNSenum、fierce
【目标检测】YOLOv7理论简介+实践测试
leetcode:126. Word Solitaire II
2022-07-31: Given a graph with n points and m directed edges, you can use magic to turn directed edges into undirected edges, such as directed edges from A to B, with a weight of 7.After casting the m
Logitech Mouse Experience Record
剑指 Offer 68 - I. 二叉搜索树的最近公共祖先
【无标题】