Question 67 of 95
Q.Ms. Zoya is a Production Manager in a factory which packages mineral water. She decides to create a table in a database to keep track of the stock present in the factory. Each record of the table will have the following fields : W_Code – Code of the item (type – CHAR(5)) W_Description – Description of the item (type – VARCHAR(20)) B_Qty – Balance quantity of the item (type – INTEGER) U_Price – Unit Price of the item (type – FLOAT) The name of the table is W_STOCK.
(i)
(a) Write an SQL command to create the above table (W_Code should be the primary key). OR
(b) Can U_Price be the primary key of the above table ? Justify your answer.
(ii)
(a) Assuming that the table W_STOCK is already created, write an SQL command to add an attribute E_Date (of DATE type) to the table. OR
(b) Assuming that the table W_STOCK is already created, write an SQL command to remove the column B_Qty from the table.
Karnataka PUCCBSE Class XII Board 2026Subjective· 2mImportance★★★★★
71% · 67/95 Questions
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →Part (a): CREATE TABLE W_STOCK with W_Code as PRIMARY KEY.
Part (b): U_Price cannot be a primary key (values repeat / may be NULL); add a column with ALTER TABLE ... ADD E_Date DATE.
Part (b): remove a column with ALTER TABLE ... DROP COLUMN B_Qty.
Part (a)
The table needs four columns of the specified types, with W_Code designated as the primary key (declared inline here):
CREATE TABLE W_STOCK (
W_Code CHAR(5) PRIMARY KEY,
W_Description VARCHAR(20),
B_Qty INTEGER,
U_Price FLOAT
);
``` …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.