Do the following:
1 - NSC Information Technology - Question 2 - 2023 - Paper 1
Question 2
Do the following:
1. Open the incomplete project file called Question2_P.dpr in the Question 2 folder.
2. Enter your examination number as a comment in the first li... show full transcript
Worked Solution & Example Answer:Do the following:
1 - NSC Information Technology - Question 2 - 2023 - Paper 1
Step 1
Button [2.1.1 - Large enrolments]
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To display all courses in the tblCourses table that can accommodate 100 or more students, the SQL query can be written as:
SELECT * FROM tblCourses
WHERE MaxStudents >= 100;
Step 2
Button [2.1.2 - Lecturer gender]
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To display the LecturerName, LecturerSurname, and abbreviated gender, the SQL query would be:
SELECT LecturerName, LecturerSurname, LEFT(Gender, 1) AS [Gender (M/F)]
FROM tblLecturers;
Step 3
Button [2.1.3 - Multilingual lecturers]
96%
101 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To display CourseID and CourseName for courses with multilingual lecturers:
SELECT CourseID, CourseName
FROM tblCourses
WHERE tblCourses.LecturerID IN (
SELECT LecturerID
FROM tblLecturers
WHERE Multilingual = TRUE
)
ORDER BY CourseName;
Step 4
Button [2.1.4 - Lecturer salaries]
98%
120 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To calculate the total salary for each lecturer based on their courses:
SELECT LecturerID, FORMAT(COUNT(*) * 10000, 'C', 'en-ZA') AS Salary
FROM tblCourses
GROUP BY LecturerID;
Step 5
Button [2.2.1 - Average duration of courses]
97%
117 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
For calculating and displaying the average course duration for each lecturer:
var
Sum, Count: Integer;
begin
Sum := 0;
Count := 0;
// Loop through each lecturer
// For each lecturer, loop through their courses
// Sum durations and count courses
// Display the average as: Average Duration: Sum / Count:0.00;
end;
Step 6
Button [2.2.2 - Register new lecturer]
97%
121 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!