Answer: The PRIMARY KEY Constraint
Explore the use of the PRIMARY KEY constraint in SQL, including how to add, modify, or remove it using ALTER TABLE. Understand the role of AUTO_INCREMENT and how these features help ensure data integrity while managing table structures.
Solution
The solution is given below:
Explanation
The explanation of the solution code is given below:
Line 2: The
ALTER TABLEquery modifies a table. TheMODIFYclause specifies which column to modify. TheAUTO_INCREMENTsets the column to increase the number automatically when a new row is added. Finally,PRIMARY KEYsets the column to beNOT NULL, and it will be used as a primary key.Line 5: The
DESC...