हिंदी

Zack is working in a database named SPORT, in which he has created a table named “Sports” containing columns SportId, SportName, no_of_players,

Advertisements

प्रश्न

Zack is working in a database named SPORT, in which he has created a table named “Sports” containing columns SportId, SportName, no_of_players, and category.

After creating the table, he realized that the attribute, category has to be deleted from the table and a new attribute TypeSport of data type string has to be added. This attribute TypeSport cannot be left blank. Help Zack write the commands to complete both the tasks.

टिप्पणी लिखिए
Advertisements

उत्तर

To delete the attribute, category:

ALTER TABLE Sports
DROP category;

To add the attribute, TypeSport

ALTER TABLE Sports
ADD TypeSport char(10) NOT NULL;
shaalaa.com
Data Types and Constraints in MySQL
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2023-2024 (March) Board Sample Paper
Advertisements
Share
Notifications



      Forgot password?
Use app×