Computer Science, asked by sumayah23, 4 months ago

While creating a table 'items' Smina forgot to set the primary key. Give the statement which she should write now to set the column 'item id' as the primary key of the table? ​

Answers

Answered by ghulamsarvar
1

Answer:

ALTER TABLE ITEMS

ADD PRIMARY KEY ('Item Id');

Explanation:

You need to alter the table while setting up the primary key, moreover, when the table is created and contains data, and the column you want to make primary key, should contain unique value and non-null data. Otherwise you have to filter out the rows before Altering the table. Its always best practice to add Primary Key at the starting, so that no duplicates or non-null are not inserted in the table.

Similar questions