2.1 SQL statements
2.1.1 Button [2.1.1 - List of bookings]
Display the booking number and the learner driver name and surname of all bookings with Bellville as test venue - NSC Information Technology - Question 2 - 2022 - Paper 1
Question 2
2.1 SQL statements
2.1.1 Button [2.1.1 - List of bookings]
Display the booking number and the learner driver name and surname of all bookings with Bellville as ... show full transcript
Worked Solution & Example Answer:2.1 SQL statements
2.1.1 Button [2.1.1 - List of bookings]
Display the booking number and the learner driver name and surname of all bookings with Bellville as test venue - NSC Information Technology - Question 2 - 2022 - Paper 1
Step 1
Button [2.1.1 - List of bookings]
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
SELECT BookingNum, DriverName, DriverSurname
FROM tblBookings
WHERE TestVenue = 'Bellville';
Step 2
Button [2.1.2 - Update test venue]
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
UPDATE tblBookings
SET TestVenue = 'Headquarters'
WHERE TestVenue IS NULL;
Step 3
Button [2.1.3 - Bellville bookings]
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
SELECT BookingNum, DriverName, DriverSurname
FROM tblBookings
WHERE TestVenue = 'Bellville';
Step 4
Button [2.1.4 - Licence types]
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
SELECT LEFT(BookingNum, 1) AS LicenceType, COUNT(*) AS Number
FROM tblBookings
GROUP BY LEFT(BookingNum, 1);
Step 5
Button [2.1.5 - Remove bookings]
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
DELETE FROM tblBookings
WHERE TestVenue = 'Pretoria'
AND BookingDate BETWEEN '2022-05-18' AND '2022-05-25';