当前位置:网站首页>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
边栏推荐
猜你喜欢
![[untitled]](/img/d5/2ac2b15818cf66c241e307c6723d50.jpg)
[untitled]

Qt项目中的日志库log4qt使用

并发编程 — 如何中断/停止一个运行中的线程?

SOC_ SD_ CMD_ FSM
![[vscode] prohibit the pylance plug-in from automatically adding import](/img/a7/d96c0c4739ff68356c15bafbbb1328.jpg)
[vscode] prohibit the pylance plug-in from automatically adding import

1290_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析

Powermanagerservice (I) - initialization

The problem of configuring opencv in qt5.13.2 is solved in detail

Concurrent programming - how to interrupt / stop a running thread?

Steps and FAQs of connecting windows Navicat to Alibaba cloud server MySQL
随机推荐
npm install -g/--save/--save-dev的区别
Unity 之 ExecuteAlways正在取代ExecuteInEditMode
ROS2——配置开发环境(五)
GPIO port bit based on Cortex-M3 and M4 with operation macro definition (can be used for bus input and output, STM32, aducm4050, etc.)
Ros2 - ros2 vs. ros1 (II)
2022.06.27_ One question per day
Interpretation of the earliest sketches - image translation work sketchygan
Ros2 topic (VIII)
ROS2——ROS2对比ROS1(二)
扫盲-以太网MII接口类型大全-MII、RMII、SMII、GMII、RGMII、SGMII、XGMII、XAUI、RXAUI
PostMessage communication
并发编程 — 死锁排查及处理
Ros2 - first acquaintance with ros2 (I)
【软件测试】03 -- 软件测试概述
摄像头的MIPI接口、DVP接口和CSI接口
ROS2——初识ROS2(一)
2022年中纪实 -- 一个普通人的经历
Log4qt usage of logbase in QT project
Inftnews | drink tea and send virtual stocks? Analysis of Naixue's tea "coin issuance"
Negative number storage and type conversion in programs