Question 1 Report
In the emergency-supply warehouse, Fig. 1 stores stock records. The manager wants to find items that are either marked urgent or have fewer than 10 units. The result should show itemName, priority and units, ordered by units from lowest to highest.
(a) State the Boolean operator needed in the condition. [1]
(b) Give the complete SQL query. [7]
(c) Explain why the priority values are enclosed in quotation marks. [2]
OR is used because an item qualifies if either condition is true. It does not need to be both urgent and below 10 units.
OR. [1]SELECT itemName, priority, units FROM StockItem WHERE priority = 'urgent' OR units < 10 ORDER BY units ASC;This displays the three requested fields, accepts either qualifying condition, and sorts units from lowest to highest. [7]
priority stores text, and urgent is a text-string literal. It must therefore be enclosed in quotation marks. [2]Everything you need to excel in your exams