Step 1: Pick the right SQL command for each part:
A new table is built with CREATE TABLE. Changing stored values is done with UPDATE. So part (i) uses CREATE TABLE and part (ii) uses UPDATE.
Step 2: Build part (i) column by column:
PID: Integer, Primary Key, so write PID INT PRIMARY KEY.
PName: Varchar of size 30, so write PName VARCHAR(30).
PCat: Char of size 15, so write PCat CHAR(15).
Price: a decimal number, so write Price DECIMAL(8,2). FLOAT would also be accepted.
Join the columns with commas inside one pair of brackets:
CREATE TABLE PRODUCTS (PID INT PRIMARY KEY, PName VARCHAR(30), PCat CHAR(15), Price DECIMAL(8,2));
Step 3: Build part (ii) from the condition:
The condition is that the category is Grocery, so the filter is WHERE PCat = 'Grocery'. The text value goes in single quotes.
The change is to add 100 to the price, so the new value is Price + 100.
Put the pieces in the order UPDATE, SET, WHERE:
UPDATE PRODUCTS SET Price = Price + 100 WHERE PCat = 'Grocery';
This statement was run on a test table. Only the Grocery row changed, from 500 to 600.
Final Answer:
The CREATE TABLE statement from Step 2 and the UPDATE statement from Step 3 answer parts (i) and (ii).