The database ShoppingMallDB contains information on different types of shops in a shopping mall and the details of the managers of the shops - NSC Information Technology - Question 2 - 2021 - Paper 1
Question 2
The database ShoppingMallDB contains information on different types of shops in a shopping mall and the details of the managers of the shops. The database contains t... show full transcript
Worked Solution & Example Answer:The database ShoppingMallDB contains information on different types of shops in a shopping mall and the details of the managers of the shops - NSC Information Technology - Question 2 - 2021 - Paper 1
Step 1
Button [2.1.1 - List of shops]
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 fields of the shops in the tblShops table sorted from the largest to the smallest according to the ShopSize field, the following SQL statement can be used:
SELECT *
FROM tblShops
ORDER BY ShopSize DESC;
Step 2
Button [2.1.2 - Manager number]
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 retrieve the manager number for each shop, use the following SQL statement:
SELECT ShopName
FROM tblShops
ORDER BY ShopSize DESC;
Step 3
Button [2.1.3 - Rental > R50 000]
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 calculate rental amounts exceeding R50 000 based on ShopSize, the SQL statement is:
SELECT ShopName, ShopSize, FORMAT(65 * ShopSize, 'Currency') AS Rental
FROM tblShops
WHERE 65 * ShopSize > 50000;
Step 4
Button [2.1.5 - Update shop name]
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 update the shop name from Jeans 4U to TeenDream, use the following SQL command:
UPDATE tblShops
SET ShopName = 'TeenDream'
WHERE ShopName = 'Jeans 4U';