CBSE · 083Class XII · 2024Section B2 marks

Question 24a

2 April 2024 · Computer Science (083)

Ms. Veda created a table named Sports in a MySQL database, containing columns Game_id, P_Age and G_name. After creating the table, she realized that the attribute, Category has to be added. Help her to write a command to add the Category column. Thereafter, write the command to insert the following record in the table:

Game_id : G42 P_Age : Above 18 G_name : Chess Category : Senior

Answer

python
ALTER TABLE Sports ADD Category VARCHAR(20);
INSERT INTO Sports VALUES('G42', 'Above 18', 'Chess', 'Senior');

Explanation

ALTER TABLE adds the new column. INSERT INTO adds the new row with the specified values.