Computer Science
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: 26900
SQL Queries
3 Likes
Answer
SQL command to add primary key in the table:
ALTER TABLE Employee ADD EmpId INTEGER
PRIMARY KEY ;
SQL command for inserting data will be:
INSERT INTO Employee (EmpId, Ename, Department, Salary)
VALUES (999, "Shweta", "Production", 26900) ;
Answered By
2 Likes
Related Questions
Write the Python statement for each of the following tasks using BUILT-IN functions/methods only:
(i) To insert an element 200 at the third position, in the list L1.
(ii) To check whether a string named, message ends with a full stop / period or not.
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.
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.
Predict 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 = '###')