Test Index

Structured Query Language (SQL) Get it on Google PlayDownload on the App Store CBSE Board Videos

© examsnet.com
Question : 34 of 58
Marks: +1, -0
(A) 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
OR
(B) Write the SQL commands to perform the following tasks :
(i) View the list of tables in the database, Exam.
(ii) View the structure of the table, Term1.
[CBSE 2024 Set 4]
Solution:  
(A)
Add the column:
ALTER TABLE Sports ADD Category VARCHAR(10);
Insert the record:
INSERT INTO Sports (Game_id, P_Age, G_name, Category)
VALUES ('G42', 'Above 18', 'Chess', 'Senior');
OR (B)
(i)
USE Exam;
SHOW TABLES;
(ii)
DESCRIBE Term1;
(or DESC Term1;)
© examsnet.com
Advertisements
Go to Question: