Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to count the number of production in SQL
    primarykey
    data
    text
    <p>I just have a problem in my SQL assignment.</p> <p>I have to list all employees who earned more than $3000.00 in my data.</p> <p>These are my tables</p> <pre><code> EMPLOYEE Table EMP_NUM EMP_NAME JOB_CLASS 101 John G. News Database Designer 102 David H. Senior Systems Analyst 103 June E. Arbough Electrical Engineer 104 Anne K. Ramoras Systems Analyst 105 Alice K. Johnson Database Designer 106 William Smithfield Programmer 107 Maria D. Alonzo Programmer 108 Ralph B. Washington Systems Analyst 111 Geoff B. Wabash Clerical Support 112 Darlene M. Smithson DSS Analyst 113 Delbert K. Joenbrood Applications Designer 114 Annelise Jones Applications Designer 115 Travis B. Bawangi Systems Analyst 118 James J. Frommer General Support ASSIGN Table EMP_NUM PROJ_NUM HOURS 101 15 19.4 102 15 23.8 103 15 23.8 105 15 35.7 106 15 12.6 104 18 32.4 112 18 44 114 18 24.6 118 18 45.3 104 22 48.4 105 22 64.7 106 22 12.8 111 22 22 113 22 23.6 101 25 56.3 107 25 24.6 108 25 23.6 112 25 41.4 114 25 33.1 115 25 45.8 118 25 30.5 JOB Table JOB_CLASS CHG_HOUR Applications Designer 48.1 Clerical Support 26.87 Database Designer 105 DSS Analyst 45.95 Electrical Engineer 84.5 General Support 18.36 Programmer 35.75 Systems Analyst 96.75 </code></pre> <p>For previous question which is listing all employees working on multiple projects, I did like this</p> <pre><code>select COUNT (a.PROJ_NUM), e.EMP_NAME from EMPLOYEE e, ASSIGN a where e.EMP_NUM = a.EMP_NUM Having COUNT (a.PROJ_NUM) &gt;= 2 group by e.EMP_NAME; </code></pre> <p>this code gave me what I wanted</p> <p>What I have trouble with now is getting list who earned more than 3000.00</p> <p>So I did like this</p> <pre><code>select COUNT (a.HOURS * j.CHG_OUR), e.EMP_NAME from EMPLOYEE e, ASSIGN a. JOB j where j.JOB_CLASS = e.JOB_CLASS and e.EMP_NUM = a.EMP_NUM Having COUNT (a.HOURS * j.CHG_OUR) &gt;= 3000 group by e.EMP_NAME; </code></pre> <p>But this time, this code did not give me what I wanted</p> <p>It only printed out error message like this</p> <pre><code>ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ended" *Cause: *Action: Error at Line: 60 Column: 26 </code></pre> <p>If you know how to fix it, please answer me</p> <p>Thank you</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload