Photo AI

The database ShoppingMallID 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-ShoppingMallID-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 ShoppingMallID 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 ShoppingMallID 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 largest to smallest according to the ShopSize field, you can use the following SQL statement:

SELECT * FROM tblShops
ORDER BY ShopSize DESC;

Step 2

Button [2.1.2 - Manager number]

99%

104 rated

Answer

The SQL query to retrieve the shop name and manager number sorted by ShopSize is:

SELECT ShopName 
FROM tblShops 
ORDER BY ShopSize DESC;

Step 3

Button [2.1.3 - Rental > R50 000]

96%

101 rated

Answer

To calculate the rental costs for each shop and display only the shops with a rental greater than R50,000, the SQL query would be:

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 relevant record, changing the shop name from 'Jeans 4U' to 'TeenDream', use the following SQL statement:

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

;