title: a query to display names of employees, leaves taken, leaves eligible and percentage
body: <p>I have these tables with the following columns :</p>
  
  <pre><code>   Employee24( EMPLOYEEID, FIRSTNAME, LASTNAME, GENDER, JOBROLES);
  
     Leave25( EMPLOYEEID,LEAVEID, LEAVETYPE, STARTDATE, ENDDATE);
  
    JOBROLESELIGIBLELE(JOBROLES, ELIGIBLE_SICK_LEAVES, ELIGIBLE_EARNED_LEAVES)
  </code></pre>
  
  <p>I want to write a query to display names of employees, leaves taken, leaves eligible and percentage </p>
  
  <pre><code>        SELECT * 
    FROM EMPLOYEE24 
    WHERE EMPLOYEEID IN (SELECT EMPLOYEEID 
                          FROM LEAVE25 L WHERE (STARTDATE-ENDDATE) AS "TAKENLEAVE"
      &lt; (SELECT (ELIGIBLE_SICK_LEAVES + ELIGIBLE_EARNED_LEAVES) AS "ELIGIBLELEAVE"
                ,TAKENLEAVE/ELIGIBLELEAVE * 100
                FROM  JOBROLESELIGIBELE));
  </code></pre>
  
  <p>Sample data :
             CREATE TABLE Employee24( EMPLOYEEID, JOBROLES ) AS
             SELECT 1, 'RoleA' FROM DUAL UNION ALL
             SELECT 2, 'RoleB' FROM DUAL UNION ALL
             SELECT 3, 'RoleB' FROM DUAL;</p>
  
  <pre><code>       CREATE TABLE Leave25( EMPLOYEEID,LEAVEID, LEAVETYPE, STARTDATE, ENDDATE) AS
         SELECT 1,1,'SickLeave',  DATE '2018-01-01', DATE '2018-01-11' FROM DUAL UNION ALL   
         SELECT 1,2,'SickLeave',  DATE '2018-01-21', DATE '2018-01-31' FROM DUAL UNION ALL
         SELECT 1,3,'EarnedLeave',DATE '2018-01-11', DATE '2018-01-21' FROM DUAL UNION ALL
         SELECT 1,4,'EarnedLeave',DATE '2018-02-01', DATE '2018-02-11' FROM DUAL UNION ALL
         SELECT 1,5,'EarnedLeave',DATE '2018-02-21', DATE '2018-03-03' FROM DUAL UNION ALL
         SELECT 2,6,'EarnedLeave',DATE '2018-02-01', DATE '2018-02-13' FROM DUAL UNION ALL
        SELECT 3,7,'SickLeave',  DATE '2018-01-01', DATE '2018-01-09' FROM DUAL;
  
  
        CREATE TABLE JOBROLESELIGIBLELE(JOBROLES, ELIGIBLE_SICK_LEAVES, ELIGIBLE_EARNED_LEAVES) AS
        SELECT 'RoleA', 14, 24 FROM DUAL UNION ALL
        SELECT 'RoleB',  7, 10 FROM DUAL;
  </code></pre>
  
  <p>EXPECTED RESULT :
        EMPLOYEEID | FIRSTNAME | LASTNAME | LEAVESTAKEN | ELIGIBLELEAVES | PERCENTAGE</p>