Duitse inligting
A - NSC Information Technology - Question 2 - 2024 - Paper 1
Question 2
Duitse inligting
A. Vra 1.1 - Free videos
SELECT Title, Duration, UploadDate, CreatorID
FROM tblVideos
WHERE FreeVideo = True;
B. Vra 1.2 - Check domain
SELECT... show full transcript
Worked Solution & Example Answer:Duitse inligting
A - NSC Information Technology - Question 2 - 2024 - Paper 1
Step 1
Knoppie [2.1.1 - Free videos]
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 retrieve free videos from the database, the SQL query will be:
SELECT Title, Duration, UploadDate, CreatorID
FROM tblVideos
WHERE FreeVideo = True;
This query selects titles, durations, upload dates, and creator IDs of videos where the FreeVideo field is set to true.
Step 2
Knoppie [2.1.2 - Check domain]
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 check the domain of creators, we can run the following query:
SELECT CreatorName, Email, Country
FROM tblCreators
WHERE NOT Email LIKE '%@gmail%' AND Country = 'South Africa';
This ensures that we are looking at creators from South Africa who do not have Gmail addresses.
Step 3
Knoppie [2.1.3 - Latest videos]
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 find the latest three videos uploaded, we can use:
SELECT TOP 3 UploadDate, VideoID, Title
FROM tblVideos
ORDER BY UploadDate DESC;
This will list the three most recent videos by their upload date.
Step 4
Knoppie [2.1.4 - Videos per creator]
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 count the number of videos per creator, the query is:
SELECT CreatorID, COUNT(*) AS VideosCount
FROM tblVideos
GROUP BY CreatorID
HAVING COUNT(*) > 5;
This retrieves the creator IDs and counts their videos, providing results only for creators with more than five videos.
Step 5
Knoppie [2.1.5 - Add new creator]
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
To add a new creator to the tblCreators table, the command will be:
INSERT INTO tblCreators
VALUES ('CreatorName', 'Email', 'Country');
This statement inserts a new record for a creator.
Step 6
Knoppie [2.2.1 - Remove creator]
97%
121 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
To remove a creator from tblCreators, follow these steps:
Begin a loop through tblCreators to find the specific creator by name.
Check against tblVideos to ensure no associated videos exist.
If no videos are found, delete the creator from tblCreators using:
tblCreators.Delete;
Complete the loop once the operation is done.
Step 7
Knoppie [2.2.2 - Change upload date]
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 change the upload date for a specific video in tblVideos:
UPDATE tblVideos
SET UploadDate = 'NewDate'
WHERE VideoID = 'SomeID';
This updates the UploadDate field for the specified VideoID, ensuring correct data handling.