Photo AI

Duitse inligting A - NSC Information Technology - Question 2 - 2024 - Paper 1

Question icon

Question 2

Duitse-inligting--A-NSC Information Technology-Question 2-2024-Paper 1.png

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

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

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

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

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

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

Answer

To remove a creator from tblCreators, follow these steps:

  1. Begin a loop through tblCreators to find the specific creator by name.
  2. Check against tblVideos to ensure no associated videos exist.
  3. If no videos are found, delete the creator from tblCreators using:
tblCreators.Delete;
  1. Complete the loop once the operation is done.

Step 7

Knoppie [2.2.2 - Change upload date]

96%

114 rated

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.

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

;