Photo AI

Knoppie [2.1.1 - iOS products] SELECT DeviceID, DeviceName FROM tblDevices WHERE OperatingSystem = 'iOS'; Knoppie [2.1.2 - Category selected] SELECT DeviceName, Category, NumInStock FROM tblDevices WHERE Category LIKE '"%" + DeviceType + '"' Knoppie [2.1.3 - Online support] SELECT DeviceName, Category, OperatingSystem FROM tblDevices D, tblManufacturers M WHERE D.ManufacturerID = M.ManufacturerID AND OnlineSupport = True ORDER BY DeviceName Knoppie [2.1.4 - Profit per manufacturer] SELECT ManufacturerID, FORMAT(SUM(NumInStock * Price * 0.6), 'CURRENCY') AS Profit FROM tblDevices GROUP BY ManufacturerID Knoppie [2.1.5 - Remove devices] DELETE FROM tblDevices WHERE Category = 'Smart speaker' AND ManufacturerID = 'M104'; - NSC Information Technology - Question 2 - 2023 - Paper 1

Question icon

Question 2

Knoppie-[2.1.1---iOS-products]-SELECT-DeviceID,-DeviceName-FROM-tblDevices-WHERE-OperatingSystem-=-'iOS';--Knoppie-[2.1.2---Category-selected]-SELECT-DeviceName,-Category,-NumInStock-FROM-tblDevices-WHERE-Category-LIKE-'"%"-+-DeviceType-+-'"'--Knoppie-[2.1.3---Online-support]-SELECT-DeviceName,-Category,-OperatingSystem-FROM-tblDevices-D,-tblManufacturers-M-WHERE-D.ManufacturerID-=-M.ManufacturerID-AND-OnlineSupport-=-True-ORDER-BY-DeviceName--Knoppie-[2.1.4---Profit-per-manufacturer]-SELECT-ManufacturerID,-FORMAT(SUM(NumInStock-*-Price-*-0.6),-'CURRENCY')-AS-Profit-FROM-tblDevices-GROUP-BY-ManufacturerID--Knoppie-[2.1.5---Remove-devices]-DELETE-FROM-tblDevices-WHERE-Category-=-'Smart-speaker'-AND-ManufacturerID-=-'M104';-NSC Information Technology-Question 2-2023-Paper 1.png

Knoppie [2.1.1 - iOS products] SELECT DeviceID, DeviceName FROM tblDevices WHERE OperatingSystem = 'iOS'; Knoppie [2.1.2 - Category selected] SELECT DeviceName, Cat... show full transcript

Worked Solution & Example Answer:Knoppie [2.1.1 - iOS products] SELECT DeviceID, DeviceName FROM tblDevices WHERE OperatingSystem = 'iOS'; Knoppie [2.1.2 - Category selected] SELECT DeviceName, Category, NumInStock FROM tblDevices WHERE Category LIKE '"%" + DeviceType + '"' Knoppie [2.1.3 - Online support] SELECT DeviceName, Category, OperatingSystem FROM tblDevices D, tblManufacturers M WHERE D.ManufacturerID = M.ManufacturerID AND OnlineSupport = True ORDER BY DeviceName Knoppie [2.1.4 - Profit per manufacturer] SELECT ManufacturerID, FORMAT(SUM(NumInStock * Price * 0.6), 'CURRENCY') AS Profit FROM tblDevices GROUP BY ManufacturerID Knoppie [2.1.5 - Remove devices] DELETE FROM tblDevices WHERE Category = 'Smart speaker' AND ManufacturerID = 'M104'; - NSC Information Technology - Question 2 - 2023 - Paper 1

Step 1

Knoppie [2.1.1 - iOS products]

96%

114 rated

Answer

To retrieve devices that operate on iOS, use the following SQL query:

SELECT DeviceID, DeviceName
FROM tblDevices
WHERE OperatingSystem LIKE 'iOS';

This command selects the DeviceID and DeviceName from the tblDevices table where the OperatingSystem matches 'iOS'.

Step 2

Knoppie [2.1.2 - Category selected]

99%

104 rated

Answer

To select devices based on a specific Category, employ this SQL query:

SELECT DeviceName, Category, NumInStock
FROM tblDevices
WHERE Category LIKE '"%" + DeviceType + '"';

This retrieves the DeviceName, Category, and Number in Stock for devices matching the specified device type.

Step 3

Knoppie [2.1.3 - Online support]

96%

101 rated

Answer

For listing devices that offer online support, the query would be:

SELECT DeviceName, Category, OperatingSystem
FROM tblDevices D, tblManufacturers M
WHERE D.ManufacturerID = M.ManufacturerID
AND D.OnlineSupport = True
ORDER BY DeviceName;

This fetches the names, categories, and operating systems of devices that support online features.

Step 4

Knoppie [2.1.4 - Profit per manufacturer]

98%

120 rated

Answer

To calculate the profit generated by each manufacturer, the following SQL statement can be executed:

SELECT ManufacturerID,
FORMAT(SUM(NumInStock * Price * 0.6), 'CURRENCY') AS Profit
FROM tblDevices
GROUP BY ManufacturerID;

This sums up the profit for each manufacturer by considering the stock and price, then formats it in currency.

Step 5

Knoppie [2.1.5 - Remove devices]

97%

117 rated

Answer

To remove devices categorized as 'Smart speaker' from the database, execute:

DELETE FROM tblDevices
WHERE Category = 'Smart speaker' AND ManufacturerID = 'M104';

This command deletes all records in tblDevices where the Category is 'Smart speaker' and the Manufacturer ID is 'M104'.

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

;