Using the solution to Activity 1.5, found in the previous section, develop a command file to create the student table and insert records into that table. Use SQL to display the entered rows.
Using the student tables created earlier, create the following reports:
Part 1: How many students are there in the college?
Part 2: How many units in total have been passed?
Part 3: How many units has each student passed?
When creating the above reports, specify your own column headings rather than using the defaults.
SELECT COUNT(*) "Total Students"
SELECT COUNT(*) "Total Units Passed"
WHERE result = 'P';
SELECT student_number "Student", COUNT(unit_number) "Units Passed"
WHERE result = 'P'
GROUP BY student_number;
Next: Activity 2.4B
(c) SQA 2009