Create a list of all sections that indicates how many places are available in each section (i.e. capacity - # of students enrolled). Use decode to display a message of "Filled" if there are no more places; " <#> places available" (as in "10 places available) if capacity has not yet been reached but some are enrolled; and "None enrolled" if no one has enrolled. Use TO_CHAR to convert numbers to strings when needed. Use an outer join to include all the sections. (78 rows)

COURSE_NO SECTION_NO Places Available
---------- ---------- --------------------------
25 1 20 places available
240 2 14 places available
134 3 24 places available
142 2 12 places available
145 3 None enrolled
...


```
SELECT s.course_no, s.section_no,
DECODE(s.capacity - COUNT(e.section_id),
0, 'Filled',
s.capacity,
'None enrolled',
TO_CHAR(s.capacity - COUNT(e.section_id))
||' places available') "Places Available"
FROM section s, enrollment e
WHERE s.section_id = e.section_id (+)
GROUP BY s.course_no, s.section_no, s.capacity
```

Computer Science & Information Technology

You might also like to view...

MC Which of the following pairs of items have a relationship that may be represented by composition?

a) Computer, hard drive. b) Book, literature. c) Car, vehicle. d) None of the above.

Computer Science & Information Technology

A(n) ________ reference is one that it is in the same relative position to the results cell

A) absolute B) virtual C) circular D) relative

Computer Science & Information Technology

Describe the difference between a linked object and an embedded object.

What will be an ideal response?

Computer Science & Information Technology

Compare and contrast process and program.

What will be an ideal response?

Computer Science & Information Technology