当前位置:网站首页>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);
边栏推荐
猜你喜欢
7 行代码搞崩溃 B 站,原因令人唏嘘!
程序员代码面试指南 CD15 生成窗口最大值数组
智芯传感输液泵压力传感器 为精准智能控制注入科技“强心剂”
Excel record of integer programming optimization model to solve the problem
深圳某游戏研发公司给每个工位都装监控,网友:堪比坐牢!
API Design Notes: The pimpl trick
7月编程排行榜来啦!这次有何新变化?
Excel做题记录——整数规划优化模型
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
MySQL4
随机推荐
[FPGA tutorial case 43] Image case 3 - image sobel edge extraction through verilog, auxiliary verification through MATLAB
typescript21-接口和类型别名的对比
数组问题之《下一个排列》、《旋转图像》以及二分查找之《搜索二维矩阵》
律师解读 | 枪炮还是玫瑰?从大厂之争谈元宇宙互操作性
lambda
这里有110+公开的专业数据集
产品经理访谈 | 第五代验证码的创新与背景
PMP 项目沟通管理
【愚公系列】2022年07月 Go教学课程 024-函数
typescript24-类型推论
时时刻刻保持敬畏之心
Typescript20 - interface
A way to deal with infinite debugger
lambda
typescript23-tuple
博客系统(完整版)
PMP子过程定义总结
报错:AttributeError: module ‘matplotlib’ has no attribute ‘figure’
Mysql基础篇(Mysql数据类型)
PAT乙级 1002 写出这个数