Question: Write a mysql query for: (tables below are departments, dept_emp, dept_manager, employees, salaries, titles respectively What's the fraction of employees has changed departments in the

Write a mysql query for: (tables below are departments, dept_emp, dept_manager, employees, salaries, titles respectively

What's the fraction of employees has changed departments in the last decade (starting from the last hire date to 10 years back from that year)

  • male
  • female
  • all employees
  • Write a mysql query for: (tables below are departments, dept_emp, dept_manager, employees,salaries, titles respectively What's the fraction of employees has changed departments inthe last decade (starting from the last hire date to 10 yearsback from that year) male female all employees emp no dept nofrom_date to_date 10001 d005 1986-06-26 9999-01-01 10002 d0071996-08-03 9999-01-01 10003 d004 1995-12-039999-01-01 10004 d004 1986-12-01 9999-01-01 10005 d003 1989-09-12 9999-01-01 10006 d0051990-08-05 9999-01-01

emp no dept no from_date to_date 10001 d005 1986-06-26 9999-01-01 10002 d0071996-08-03 9999-01-01 10003 d004 1995-12-03 9999-01-01 10004 d004 1986-12-01 9999-01-01 10005 d003 1989-09-12 9999-01-01 10006 d0051990-08-05 9999-01-01 10007 d008 10008 d0051998-03-11 2000-07-31 10009 d006 10010 d004 1996-11-24 2000-06-26 10010 d006 2000-06-26 9999-01-01 10011 d0091990-01-22 1996-11-09 10012 d005 1992-12-18 9999-01-01 10013 d003 10014 d005 10015 d0081992-09-19 1993-08-22 10016 d0071998-02-11 9999-01-01 10017 d0011993-08-03 9999-01-01 10018 d004 1992-07-29 9999-01-01 10018 d0051987-04-03 1992-07-29 10n10dnns 1989-02-10 9999-01-01 1985-02-18 9999-01-01 1985-10-20 9999-01-01 1993-12-29 9999-01-01 emp no dept no from_date to_date 110022 d001 1985-01-01 1991-10-01 110039 d0011991-10-01 9999-01-01 110085 d002 1985-01-01 1989-12-17 110114 d0021989-12-17 9999-01-01 10183 d003 110228 d0031992-03-21 9999-01-01 110303 d004 1985-01-01 1988-09-09 110344 d004 1988-09-09 1992-08-02 110386 d004 1992-08-02 1996-08-30 110420 do04 110511 d005 1985-01-01 1992-04-25 110567 d0051992-04-25 9999-01-01 110725 d006 110765 d0061989-05-06 1991-09-12 110800 d006 1991-09-12 1994-06-28 110854 d0061994-06-28 9999-01-01 111035 d0071985-01-01 1991-03-07 111133 d0071991-03-07 9999-01-01 111400 d008 111534 d008 1991-04-08 9999-01-01 1985-01-01 1992-03-21 1996-08-30 9999-01-01 1985-01-01 1989-05-06 1985-01-01 1991-04-08 0511 1089-10-17 emp_no birth_datefirst_name last_name gender hire_date 10010 1963-06-01 Duangkaew Piveteau F 10013 1963-06-07 Eberhardt Terkki 2 5 10017 1958-07-06 Cristinel emp_no salary from_ date to_date 10001 60117 1986-06-26 1987-06-26 10001 62102 1987-06-26 1988-06-25 10001 66074 1988-06-25 1989-06-25 10001 66596 1989-06-25 1990-06-25 10001 66961 1990-06-25 1991-06-25 10001 71046 1991-06-25 1992-06-24 10001 74333 1992-06-24 1993-06-24 10001 75286 1993-06-24 1994-06-24 10001 75994 1994-06-24 1995-06-24 10001 76884 1995-06-24 1996-06-23 1000180013 1996-06-23 1997-06-23 10001 81025 1997-06-23 1998-06-23 1000181097 1998-06-23 1999-06-23 10001 84917 1999-06-23 2000-06-22 1000185112 2000-06-22 2001-06-22 10001 85097 2001-06-22 2002-06-22 10001 88958 2002-06-22 9999-01-01 10002 65828 1996-08-03 1997-08-03 10002 65909 1997-08-03 1998-08-03 10002 67534 1998-08-03 1999-08-03 8 10004 Engineer 5 10007 Senior Staff 10008 Assistant Engi.. 1998-03-11 2000-07-31 10009 Assistant Engi... 1985-02-18 1990-02-18 10009 Senior Engineer 1995-02-18 9999-01-01 titles 1 emp no dept no from_date to_date 10001 d005 1986-06-26 9999-01-01 10002 d0071996-08-03 9999-01-01 10003 d004 1995-12-03 9999-01-01 10004 d004 1986-12-01 9999-01-01 10005 d003 1989-09-12 9999-01-01 10006 d0051990-08-05 9999-01-01 10007 d008 10008 d0051998-03-11 2000-07-31 10009 d006 10010 d004 1996-11-24 2000-06-26 10010 d006 2000-06-26 9999-01-01 10011 d0091990-01-22 1996-11-09 10012 d005 1992-12-18 9999-01-01 10013 d003 10014 d005 10015 d0081992-09-19 1993-08-22 10016 d0071998-02-11 9999-01-01 10017 d0011993-08-03 9999-01-01 10018 d004 1992-07-29 9999-01-01 10018 d0051987-04-03 1992-07-29 10n10dnns 1989-02-10 9999-01-01 1985-02-18 9999-01-01 1985-10-20 9999-01-01 1993-12-29 9999-01-01 emp no dept no from_date to_date 110022 d001 1985-01-01 1991-10-01 110039 d0011991-10-01 9999-01-01 110085 d002 1985-01-01 1989-12-17 110114 d0021989-12-17 9999-01-01 10183 d003 110228 d0031992-03-21 9999-01-01 110303 d004 1985-01-01 1988-09-09 110344 d004 1988-09-09 1992-08-02 110386 d004 1992-08-02 1996-08-30 110420 do04 110511 d005 1985-01-01 1992-04-25 110567 d0051992-04-25 9999-01-01 110725 d006 110765 d0061989-05-06 1991-09-12 110800 d006 1991-09-12 1994-06-28 110854 d0061994-06-28 9999-01-01 111035 d0071985-01-01 1991-03-07 111133 d0071991-03-07 9999-01-01 111400 d008 111534 d008 1991-04-08 9999-01-01 1985-01-01 1992-03-21 1996-08-30 9999-01-01 1985-01-01 1989-05-06 1985-01-01 1991-04-08 0511 1089-10-17 emp_no birth_datefirst_name last_name gender hire_date 10010 1963-06-01 Duangkaew Piveteau F 10013 1963-06-07 Eberhardt Terkki 2 5 10017 1958-07-06 Cristinel emp_no salary from_ date to_date 10001 60117 1986-06-26 1987-06-26 10001 62102 1987-06-26 1988-06-25 10001 66074 1988-06-25 1989-06-25 10001 66596 1989-06-25 1990-06-25 10001 66961 1990-06-25 1991-06-25 10001 71046 1991-06-25 1992-06-24 10001 74333 1992-06-24 1993-06-24 10001 75286 1993-06-24 1994-06-24 10001 75994 1994-06-24 1995-06-24 10001 76884 1995-06-24 1996-06-23 1000180013 1996-06-23 1997-06-23 10001 81025 1997-06-23 1998-06-23 1000181097 1998-06-23 1999-06-23 10001 84917 1999-06-23 2000-06-22 1000185112 2000-06-22 2001-06-22 10001 85097 2001-06-22 2002-06-22 10001 88958 2002-06-22 9999-01-01 10002 65828 1996-08-03 1997-08-03 10002 65909 1997-08-03 1998-08-03 10002 67534 1998-08-03 1999-08-03 8 10004 Engineer 5 10007 Senior Staff 10008 Assistant Engi.. 1998-03-11 2000-07-31 10009 Assistant Engi... 1985-02-18 1990-02-18 10009 Senior Engineer 1995-02-18 9999-01-01 titles 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!