db.migration.sql.V003__SALARY.sql Maven / Gradle / Ivy
use OBJECTOS_SQL;
create table SALARY (
EMP_NO int not null,
SALARY int not null,
FROM_DATE date not null,
TO_DATE date not null,
foreign key (EMP_NO) references EMPLOYEE (EMP_NO) on delete cascade,
primary key (EMP_NO, FROM_DATE)
) engine=InnoDB;
insert into
SALARY (EMP_NO, SALARY, FROM_DATE, TO_DATE)
values
(1, 1000, '2010-01-01', '2010-12-31'),
(1, 2500, '2011-01-01', '2011-12-31'),
(1, 3000, '2012-01-01', '2012-12-31'),
(2, 1000, '2010-01-01', '2010-12-31'),
(2, 2500, '2011-01-01', '2011-12-31'),
(2, 3000, '2012-01-01', '2012-12-31'),
(2, 4000, '2013-01-01', '2013-12-31'),
(2, 5000, '2014-01-01', '2014-12-31'),
(3, 1000, '2010-01-01', '2010-12-31'),
(3, 2500, '2011-01-01', '2011-12-31'),
(3, 3000, '2012-01-01', '2012-12-31');
© 2015 - 2024 Weber Informatics LLC | Privacy Policy