I have a Classes table which is as follows:
Classes(classid, dept_code, course#, sect#, year, semester, limit, class_size, room, TA_B#)
The qeustion is: Find the classid, dept_code and course# of each undergraduate class (i.e., course# < 500) that was offered in Spring 2017. For each such class, also list the number of seats available (computed by limit – class_size) under the header “seats_available”.
I tried this simple approach:
select classes.classid, classes.dept_code, classes.course#,
classes.limit-classes.class_size as'seats_available'
from classes
where limit>class_size and year='2017' and semester='Spring'and course# < 500;
0 But I am getting an error:
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
What am I missing? This error will go if I remove this code of line:classes.limit-classes.class_size as'seats_available'
I am using Oracle database