Page 31 - IPP-12-2025
P. 31
Write a Python program to create a Pandas series, as shown below, using a dictionary. Note that the left
column indicates the indices and the right column displays the data.
Rose USA
Lily France
Tulip Netherlands
Lotus India
Maple Leaf Canada
31. (a) Write an SQL statement to create a table named LIBRARY with the following specifications: [2+1=3]
Column Name Data Type Key
Book_ID Numeric primary key
Title Varchar(30)
Price Numeric
Author Varchar(35) Not NULL
Publisher Varchar(35)
(b) Write an SQL query to insert the following data in table LIBRARY:
'B101', 'Informatics Practices With Python', 685, 'Preeti Arora', 'Sultan
Chand & Sons'
32. Consider the following tables: [3]
Table 1:
FLIGHT which stores Flight ID (FID), Flight Name (F_Name), Airline Name (Airline_Name).
Table 2:
FARE, which stores Flight ID (FID), Source (Source), Destination (Destination), Charges (Charges),
FareID (Fare_ID).
Table: FLIGHT
FID F_Name Airline_Name
F101 SkyJet 101 Indigo
F102 AirConnect 205 Air India
F103 GoFly 330 Indigo
F104 ZoomAir 450 SpiceJet
Table: FARE
Fare_ID FID Source Destination Charges
FR201 F101 Delhi Mumbai 4500.00
FR202 F102 Chennai Delhi 5200.00
FR203 F103 Kolkata Bengaluru 4800.00
FR204 F104 Mumbai Hyderabad 4100.00
Write appropriate SQL queries for the following:
(a) Display the flight id, flight name and their charges.
(b) Display the details of all fares with charges less than 5000.
(c) Display the total number of flights on the basis of airline names.
Or
Consider the following tables:
Table 1:
STUDENTS, which stores RegID, Stu_Name, Course. This table displays basic information about students.
Table 2:
BATCH, which stores Batch_No, RegID and Shift. This table displays information about batches.
P.4 Informatics Practices with Python–XII