Photo AI

Use ONLY SQL code to answer QUESTION 2.1 to QUESTION 2.1.5 - NSC Information Technology - Question 2 - 2022 - Paper 1

Question icon

Question 2

Use-ONLY-SQL-code-to-answer-QUESTION-2.1-to-QUESTION-2.1.5-NSC Information Technology-Question 2-2022-Paper 1.png

Use ONLY SQL code to answer QUESTION 2.1 to QUESTION 2.1.5. 2.1.1 Button [2.1.1 - List of bookings]. Display the booking number and the learner driver name and sur... show full transcript

Worked Solution & Example Answer:Use ONLY SQL code to answer QUESTION 2.1 to QUESTION 2.1.5 - NSC Information Technology - Question 2 - 2022 - Paper 1

Step 1

Button [2.1.1 - List of bookings]

96%

114 rated

Answer

SELECT BookingNum, DriverName
FROM tblBookings
ORDER BY BookingDate;

Step 2

Button [2.1.2 - Update test venue]

99%

104 rated

Answer

UPDATE tblBookings
SET TestVenue = 'Headquarters'
WHERE TestVenue IS NULL;

Step 3

Button [2.1.3 - Bellville bookings]

96%

101 rated

Answer

SELECT BookingNum, LDriverName, LDriverSurname
FROM tblBookings
WHERE TestVenue = 'Bellville';

Step 4

Button [2.1.4 - Licence types]

98%

120 rated

Answer

SELECT LEFT(BookingNum, 1) AS LicenceType, COUNT(*) AS Number
FROM tblBookings
GROUP BY LicenceType;

Step 5

Button [2.1.5 - Remove bookings]

97%

117 rated

Answer

DELETE FROM tblBookings
WHERE TestVenue = 'Pretoria'
AND BookingDate BETWEEN '2022-05-18' AND '2022-05-25';

Join the NSC students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;