Page 375 - Informatics_Practices_Fliipbook_Class12
P. 375
32. Consider the dataframe eventDF:
Event No Event Name Location
A101 IT Quiz Building A
B102 Web Designing Building B
C103 Coding Building C
D104 App Designing Building A
E105 Poster Making Building B
Here, Event No, Event Name and Location are the column labels with default row labels. Write python statements
to:
a. display names of all events from eventDF.
b. add a new column noOfParticipants with values 25, 78, 96, 34, and 60.
c. display 2nd to 4th row.
OR
(Option for part iii only)
Write Python statement to export the DataFrame eventDF to a CSV file named pythondata.csv.
Section-E
33. What is the output produced on the execution of following SQL statements?
a. SELECT POW(2,3);
b. SELECT ROUND(123.2345, 2), ROUND(342.9234,-1);
c. SELECT LENGTH("Informatics Practices");
d. SELECT YEAR("1979/11/26"), MONTH("1979/11/26"), DAY("1979/11/26"), MONTHNAME
("1979/11/26");
e. SELECT LEFT("INDIA",3), RIGHT("Computer Science",4);
OR
Consider the table INVENTORY given below:
mysql> SELECT * FROM INVENTORY;
CarId CarName Price Model YearManufacture Fueltype
D001 Car1 582613.00 LXI 2017 Petrol
D002 Car1 673112.00 VXI 2018 Petrol
B001 car2 567031.00 Sigmal.2 2019 Petrol
B002 Car2 647858.00 Deltal.2 2018 Petrol
E001 Car3 355205.00 5 STR STD 2017 CNG
E002 car3 654914.00 CARE 2018 CNG
S001 car4 514000.00 LXI 2017 Petrol
S002 car4 614000.00 VXI 2018 Petrol
Practice Paper 2 361

