Computer Science
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.
SQL Queries
4 Likes
Answer
SQL command to delete the attribute category from the table Sports:
ALTER TABLE Sports
DROP category ;
SQL command to add the attribute TypeSport to the table Sports:
ALTER TABLE Sports
ADD TypeSport char(10) NOT NULL ;
Answered By
1 Like
Related Questions
A list named studentAge stores age of students of a class. Write the Python command to import the required module and (using built-in function) to display the most common age value from the given list.
Ms. Shalini has just created a table named “Employee” containing columns Ename, Department and Salary. After creating the table, she realized that she has forgotten to add a primary key column in the table. Help her in writing an SQL command to add a primary key column EmpId of integer type to the table Employee. Thereafter, write the command to insert the following record in the table:
EmpId - 999
Ename - Shweta
Department: Production
Salary: 26900Predict the output of the following code:
def Changer(P, Q = 10): P = P / Q Q = P % Q return P A = 200 B = 20 A = Changer(A, B) print(A, B, sep = '$') B = Changer(B) print(A, B, sep = '$', end = '###')
Predict the output of the Python code given below:
Text1 = "IND-23" Text2 = "" I = 0 while I < len(Text1): if Text1[I] >= "0" and Text1[I] <= "9": Val = int(Text1[I]) Val = Val + 1 Text2 = Text2 + str(Val) elif Text1[I] >= "A" and Text1[I] <= "Z": Text2 = Text2 + (Text1[I + 1]) else: Text2 = Text2 + "*" I += 1 print(Text2)