2023 - 2024 Final Term Paper
2023 - 2024 Final Term Paper
28. Mr. Anthony is a database administrator and working on table Employee", He wants to: 3
(i) Change the name of the column "Bonus to "Appr Amt" with type
(ii) Delete the column "Extra Income" from the table. int.
(iii) Add a new column "aadhar" of datatype varchar and size 20.
Help him to write the MySQL command.
29. What do you mean by DDL commands? Define any two DDL commands with
30. Ms. Anee is working in a welfare organization and has been assigned suitable example. 3
a task to maintain the
details of workshops conducted by the
with the following structure in MySQL: organization,
Help her to create the table Workshop
Table: Workshop
Field Type Size Constraint
Workshopld int Primary Key
|Title Varchar 50 Not null
DateWorkshop Date
Venue Varchar |30 Default 'Delhi'
REDMI NOTE 13 56 -0--01--20.25-5:23
SECTION - D
31. Consider the given code and answer the given statements:
dl="Name":"Ankit'","Class"':1 1, "Sec":"A","Name":"Rahul" "Roll".12}
What will be the output?
i. print(len(d 1)
ii. print(di["Name")
i11. print("Name" in d1)
iv. print(dl.values() 4
32. Consider the following table Furniture':
FCODE NAME PRICE MANUFDATE WCODE
10023 Coffee talble 4000 |19-DEC-2016 W03
10001 |Dining table 20500 12-JAN-2017 WO1
10012 Sofa 35000 l06-JUN-2016 W02
10024 Chair 2500 07-APR-2017 W03
10090Cabinet 18000 31-MAR-2015 W02
Write SQL commands:
i. To display FCODE, NAME and PRICE of items that have PRICE less than 5000.
ii. To display NAMESand PRICE of those Furniture Items that have "table' anywhere in
their names.
ii. To display WCODE of Furniture Items. There should be no duplicate values.
iv. To update the price of all furniture by 10 percent.
SECTION E
33. Writea python program to print all the magic numbers between 1 and 1000. 5
[Hint: The magic number can be defined as anumber which will yield1when it is replaced by
the sum digits repeatedly. For eg: 19>1+9=10>1+01]
34. Consider the given list: 5
LI=[10,20,[30,40],"Python",50]
a. Write python code to add an element "Tokens" at index 2.
b. Write python code to delete the value 30 from the list LI.
c. Write python code to delete all the elements of the list L1. (List object
should not be deleted).
d. Write python code to find the index of the element "Python'".
e. Write python code to remove and return the element at index 3.
35. Consider the following table Exam:
5
Adno SName
R001Sushant
Percentage
90,2
Cl section Stream
12A Science
RO02 Vaidyanath 80.5 12B
RO03 Miara 68,9 12B
Humanities
R004 Niara 96.0 12A
Science
RO05 Shinjini - 88.9
Commerce
12D
Write the SQL commands for the (i)to (iii) and write Commerce
basis of the given table Exam: the output of the (iv) and (v) on the
(i) Todisplay Adno, Name, Percentage of
(11) To increase percentage by 2% of all thestudents of Science Stream.
(ii)To delete the records of those Humanities students.
(iv) SELECT sname, percentage from students whose percentage is less than 70%.
exam order by
(v) SELECT sname from exam
where stream=Sciencepercentage;
and Percentage>85;