当前位置:网站首页>Database SQL practice 4. Find the last of employees in all assigned departments_ Name and first_ name
Database SQL practice 4. Find the last of employees in all assigned departments_ Name and first_ name
2022-07-05 07:12:00 【Just as young】
Title Description
Find all the employees in the assigned department last_name and first_name as well as dept_no( Notice the order of the columns in the output description )
CREATE TABLE `dept_emp` (
`emp_no` int(11) NOT NULL,
`dept_no` char(4) NOT NULL,
`from_date` date NOT NULL,
`to_date` date NOT NULL,
PRIMARY KEY (`emp_no`,`dept_no`));
CREATE TABLE `employees` (
`emp_no` int(11) NOT NULL,
`birth_date` date NOT NULL,
`first_name` varchar(14) NOT NULL,
`last_name` varchar(16) NOT NULL,
`gender` char(1) NOT NULL,
`hire_date` date NOT NULL,
PRIMARY KEY (`emp_no`));
Input description :
nothing
Output description :
last_name | first_name | dept_no |
---|---|---|
Facello | Georgi | d001 |
Omit | Omit | Omit |
Piveteau | Duangkaew | d006 |
Implementation code
select e.last_name, e.first_name, d.dept_no
from employees as e
inner join dept_emp as d
on e.emp_no = d.emp_no
边栏推荐
- ROS2——常用命令行(四)
- Negative number storage and type conversion in programs
- C learning notes
- 1290_ Implementation analysis of prvtaskistasksuspended() interface in FreeRTOS
- Ros2 - common command line (IV)
- Ros2 - Service Service (IX)
- npm install -g/--save/--save-dev的区别
- Executealways of unity is replacing executeineditmode
- Ros2 - configuration development environment (V)
- [node] NVM version management tool
猜你喜欢
【软件测试】06 -- 软件测试的基本流程
[software testing] 06 -- basic process of software testing
docker安装mysql并使用navicat连接
Negative number storage and type conversion in programs
inux摄像头(mipi接口)简要说明
SD_CMD_RECEIVE_SHIFT_REGISTER
[vscode] prohibit the pylance plug-in from automatically adding import
目标检测系列——Faster R-CNN原理详解
SOC_ SD_ DATA_ FSM
Mathematical analysis_ Notes_ Chapter 8: multiple integral
随机推荐
ROS2——功能包(六)
基于FPGA的一维卷积神经网络CNN的实现(八)激活层实现
U-Boot初始化及工作流程分析
Ros2 - common command line (IV)
基于Cortex-M3、M4的GPIO口位带操作宏定义(可总线输入输出,可用于STM32、ADuCM4050等)
Unity 之 ExecuteAlways正在取代ExecuteInEditMode
2022年中纪实 -- 一个普通人的经历
2022.06.27_ One question per day
[vscode] prohibit the pylance plug-in from automatically adding import
Concurrent programming - how to interrupt / stop a running thread?
【软件测试】02 -- 软件缺陷管理
Ros2 - ros2 vs. ros1 (II)
[software testing] 03 -- overview of software testing
Negative number storage and type conversion in programs
Architecture
postmessage通信
IPage can display data normally, but total is always equal to 0
Do you choose pandas or SQL for the top 1 of data analysis in your mind?
window navicat连接阿里云服务器mysql步骤及常见问题
Literacy Ethernet MII interface types Daquan MII, RMII, smii, gmii, rgmii, sgmii, XGMII, XAUI, rxaui