One Mark Sep 2023
One Mark Sep 2023
(a) To display CNAME, AREA of all female customers from CUSTOMER table.
(b) To display the details of all the CUSTOMERS in ascending order of CNAME
(c) To display the total number of customers for each AREA from CUSTOMER table.
(d) To display CNAME and corresponding SHOP from CUSTOMER table and ONLINESHOP
table.
23.How will you change the file pointer position to an offset value from the beginning position?
(a) To display NAME, FEE, Gender, JOINYEAR about the APPLICANTS, who have
joined before 2010.
(c) To display the year and the total number of applicants joined in each year from the table
APPLICANTS.
25.The code given below reads records from the table named Vehicle and displays only those
records which have model lasser than 2010.The structure of a record of table Vehicle is: (3)
V_ID–integer; Name–string; Model –integer; Price–integer
Note the following to establish connectivity between Python and MYSQL:
Username is root
Password is abc
The table exists in a MYSQL database named Transport.
The details(RollNo,Name,ClasandMarks)are to be accepted from the user.
Write the following missing statements to complete the code:
Statement1–to create the cursor object
Statement2–to execute the query that extracts records of those vehicles whose model
is greater than 2010.
Statement3-to read the complete result of the query in to the object named data.
import mysql.connector as mysql
def display():
con1=mysql.connect(host="localhost",user="root",password="abc",database="Transport")
#Statement 1print("Students with marks
greater than 75 are : ")q="Select*fromvehiclewheremodel>2010"
#Statement2
data= #Statement3
for rec in data:
print(rec)
26.Fill in the blank: (1)
command is used to remove a column from a table in SQL.
a)update b) remove c)alter d)drop
27.Which of the following is an invalid identifier? (1)
ii.selectname,salaryfromemployeewheredojlike'2015%';
iv.selectmin(doj),max(dob)fromemployee;