CBSE · 083Class XII · 2023Section E2 marks
Question 34(3or)
30 March 2023 · Computer Science (083)
(iii) Write the statements to : (a) Add a constraint PRIMARY KEY to the column LABNO in the table LAB. (b) Delete the table LAB.
Answer
(a)
sql
ALTER TABLE LAB ADD PRIMARY KEY (LABNO);(b)
sql
DROP TABLE LAB;Explanation
(a) ALTER TABLE ... ADD PRIMARY KEY attaches a primary-key constraint to an existing column. (b) DROP TABLE removes both the table structure and its data permanently.