Photo AI

SQL-stellings Knoppie [2.1.1 - iOS products] SELECT DeviceID, DeviceName FROM tblDevices WHERE OperatingSystem = 'iOS' Alternatief: WHERE OperatingSystem LIKE 'iOS' Knoppie [2.1.2 - Category selected] SELECT DeviceName, Category, NumInStock FROM tblDevices WHERE Category LIKE '"%" + :DeviceType + '"' Alternatief: WHERE Category LIKE 'Smart' + :DeviceType + '"' Anwaar ook QuotedStr Knoppie [2.1.3 - Online support] SELECT DeviceName, Category, OperatingSystem FROM tblDevices D, tblManufacturers M WHERE D.ManufacturerID = M.ManufacturerID AND D.OnlineSupport = True ORDER BY DeviceName Knoppie [2.1.4 - Profit per manufacturer] 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

SQL-stellings--Knoppie-[2.1.1---iOS-products]-SELECT-DeviceID,-DeviceName-FROM-tblDevices-WHERE-OperatingSystem-=-'iOS'--Alternatief:-WHERE-OperatingSystem-LIKE-'iOS'--Knoppie-[2.1.2---Category-selected]-SELECT-DeviceName,-Category,-NumInStock-FROM-tblDevices-WHERE-Category-LIKE-'"%"-+-:DeviceType-+-'"'--Alternatief:-WHERE-Category-LIKE-'Smart'-+-:DeviceType-+-'"'--Anwaar-ook-QuotedStr--Knoppie-[2.1.3---Online-support]-SELECT-DeviceName,-Category,-OperatingSystem-FROM-tblDevices-D,-tblManufacturers-M-WHERE-D.ManufacturerID-=-M.ManufacturerID-AND-D.OnlineSupport-=-True-ORDER-BY-DeviceName--Knoppie-[2.1.4---Profit-per-manufacturer]-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

SQL-stellings Knoppie [2.1.1 - iOS products] SELECT DeviceID, DeviceName FROM tblDevices WHERE OperatingSystem = 'iOS' Alternatief: WHERE OperatingSystem LIKE 'iOS... show full transcript

Worked Solution & Example Answer:SQL-stellings Knoppie [2.1.1 - iOS products] SELECT DeviceID, DeviceName FROM tblDevices WHERE OperatingSystem = 'iOS' Alternatief: WHERE OperatingSystem LIKE 'iOS' Knoppie [2.1.2 - Category selected] SELECT DeviceName, Category, NumInStock FROM tblDevices WHERE Category LIKE '"%" + :DeviceType + '"' Alternatief: WHERE Category LIKE 'Smart' + :DeviceType + '"' Anwaar ook QuotedStr Knoppie [2.1.3 - Online support] SELECT DeviceName, Category, OperatingSystem FROM tblDevices D, tblManufacturers M WHERE D.ManufacturerID = M.ManufacturerID AND D.OnlineSupport = True ORDER BY DeviceName Knoppie [2.1.4 - Profit per manufacturer] 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 find all iOS products from the tblDevices, you can write the following SQL query:

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

Alternatively, you could use the LIKE clause as shown below:

WHERE OperatingSystem LIKE 'iOS';

Step 2

Knoppie [2.1.2 - Category selected]

99%

104 rated

Answer

To select the device name, category, and stock numbers where the category matches a specific DeviceType, use the following SQL query:

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

An alternative query can be written as follows:

WHERE Category LIKE 'Smart' + :DeviceType + '"';

Step 3

Knoppie [2.1.3 - Online support]

96%

101 rated

Answer

To retrieve devices that support online transactions, the following query should be used:

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

Step 4

Knoppie [2.1.4 - Profit per manufacturer]

98%

120 rated

Answer

To calculate the profit per manufacturer based on stock numbers and price, utilize this SQL query:

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

Step 5

Knoppie [2.1.5 - Remove devices]

97%

117 rated

Answer

To remove devices from the tblDevices, specifically those categorized as 'Smart speaker' from a certain manufacturer, the SQL command would be:

DELETE FROM tblDevices 
WHERE Category = 'Smart speaker' AND ManufacturerID = '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

;