Www.cs2study.com



AISSCE Practical Examination 2020 – 2021COMPUTER SCIENCE – 083SET – 1Q1A binary file “CAR.dat” has structure [carNo, carname, mileage]Write a user defined function ADD() to input data for a record and add to CAR.dat.Write a function SHOW(carNo) in Python which accepts the car number as parameter and display details according to this carNo from the file CAR.dat7Q2Keeping in view of MySQL data connectivity with Python,fill in the blanks with appropriate SQL queries to make the code as per the following instructions:Python code to perform the following tasks:Create a database named STOCKOpen the above created databaseCreate a table named ITEMS with attributes asINO of type INTEGER ,size 5INAME of type CHAR,size 20QUANTITY of type INTEGER,size 3Insert 3 records into the table of ITEMS as followsINOINAMEQUANTITY1PEN1002 PENCIL1503 ERASER200Fetch and display all the records from the table ITEMSSTUB Programimport mysql.connector as mdb=m.connect(host=‘localhost’,user=’root’,passwd=’1234’)c=db.corsor()#create a database STOCKc.execute(_______________________________________________)#open the database STOCKc.execute(_______________________________________________)#Create a table ITEMSc.execute(_______________________________________________)#insert 3 rows with above data in table ITEMSc.execute(_______________________________________________)c.execute(_______________________________________________)c.execute(_______________________________________________)#Fetch and display all the records from the table ITEMSc.execute(_______________________________________________)R=c.fetchall()for i in R: print(i)5AISSCE Practical Examination 2020 – 2021COMPUTER SCIENCE – 083SET – 2Q1Given a stack named book_details that contains book_no, book_name and price. Write code to implement the following functions for the stack.Push(book_details):- a function to add a book in the stack, The details of book_no, book_name and price should be entered in the functionPOP(book_details):- a function to delete a book from the stack and return its detailsDISP()- to display all details from stack book_details7Q2 Keeping in view of MySQL data connectivity with Python, fill in the blanks with appropriate SQL queries to make the code as per the following instructions:Python code to perform the following tasks:Create a database named ORGOpen the above created databaseCreate a table named COMPANY with attributes asCID of type integer ,size 3NAME of type CHAR,size 20CITY of type CHAR ,size 20PRODUCTNAME of type CHAR,size 10Insert 2 records into the table of COMPANY as followsCIDNAMECITYPRODUCTNAME111SONYDELHITV222NOKIAMUMBAIMOBILE333ONIDADELHITVFetch and display information whose PRODUCTNAME is TVSTUB Programimport mysql.connector as mdb=m.connect(host=‘localhost’,user=’root’,passwd=’1234’)c=db.cursor()#create a database ORGc.execute(_______________________________________________)#open the database ORGc.execute(_______________________________________________)#Create a table COMPANYc.execute(_______________________________________________)#insert 3 rows with above data in table COMPANYc.execute(_______________________________________________)c.execute(_______________________________________________)c.execute(_______________________________________________)# Fetch and display information whose PRODUCTNAME is TV c.execute(_______________________________________________)R=c.fetchall()for i in R: print(i)AISSCE Practical Examination 2020 – 2021COMPUTER SCIENCE – 083SET – 3Q1Given a queue named book_details that contains book_no, book_name and price. Write code to implement the following functions for the queue.Enqueue(book_details):- a function to add a book in the queue, The details of book_no, book_name and price should be entered in the functionDequeue(book_details):- a function to delete a book from the queue and return its detailsDisplay()-To display all details from Queue book_details7Q2 Keeping in view of MySQL data connectivity with Python, fill in the blanks with appropriate SQL queries to make the code as per the following instructions:Python code to perform the following tasks:Create a database named AIRLINEOpen the above created databaseCreate a table named FLIGHTS with attributes asFNO of type CHAR ,size 5SOURCE of type CHAR,size 20DEST of type CHAR ,size 20NO_OF_FL of type integer,size 3NO_OF_STOP of type integer,size 3d. Insert 3 records into the table of FLIGHTS as followsFNOSOURCEDESTNO_OF_FLNO_OF_STOP IC301MUMBAIBANGALORE32IC799BANGALOREKOLKATA83MC101DELHIVARANASI60e. Fetch and display destination in descending order from the table FLIGHTS .STUB Programimport mysql.connector as mdb=m.connect(host=‘localhost’,user=’root’,passwd=’1234’)c=db.cursor()#create a database AIRLINEc.execute(_______________________________________________)#open the database AIRLINEc.execute(_______________________________________________)#Create a table FLIGHTSc.execute(_______________________________________________)#insert 3 rows with above data in table FLIGHTSc.execute(_______________________________________________)c.execute(_______________________________________________)c.execute(_______________________________________________)#Fetch and display destination in descending order from the table FLIGHTSc.execute(_______________________________________________)R=c.fetchall()for i in R: print(i)5 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download