Photo AI

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 icon

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-NSC Information Technology-Question 2-2021-Paper 1.png

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

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

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

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

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';

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

;