SQL 实战
时间:2021-07-01 10:21:17
帮助过:23人阅读
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`));
select employees.last_name ,first_name ,dept_emp.dept_no
from dept_emp inner join employees
on dept_emp.emp_no=employees.emp_no;
er
SQL 实战
标签:from date ast blog gpo markdown key source end