Question
Mr. Iqbal is a programmer, who has recently joined the company and given a task to write a python code to perform the following binary file operations with the help of two user defined functions/modules:
(a)

Answer

(a) import pickle

(b) stud.dat

(c) file.tell()

(d) file.seek(pos)

(e) pickle.dump(st,file)

(f) (iii) pickle.dump(LST,FILE)

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Consider the table LOANS given below:

Table: LOANS

AccNo Name Loan Amt EMI IntRate Start Date Interest
1001 R.K. Gupta 300000 36 12.00 19-07-2009 1200
1002 S. P. Shanna 500000 48 10.00 22-03-2008 1800
1003 K.P. Jain 300000 36 NULL 08-03-2007 1600
1004 M.P. Yadav 800000 60 10.00 06-12-2008 2250
1005 S.P. Sinlia 200000 36 12.50 03-01-2010 4500
1006 P. Shanna 700000 60 12.50 05-06-2008 3500
1007 K.S. Dhall 500000 48 NULL 05-03-2008 3800

(a) State the command that will give the output as:

Name
S. P. Shanna
K.S. Dhall
M.P. Yadav
P. Shanna
K.S. Dhall

(i) Select name from LOANS where Name >‘D ’;

(ii) Select name from LOANS where AccNo >1001;

(iii) Select name from LOANS where Loan_Amt >= 500000;

(iv) Select name from LOANS where Loan_Amt >500000 order Loan_AmtDESC;

(b) What will be the output of the following command:

Select name, EMI from LOANS where Loan_Amt >500000 and Int_Rate is NULL;

(c) John has given the following command to display the count of all loan holders whose name ends with “Sharma ”:

Select count() from LOANS where Name like ‘Sharma%’;

But he is not getting the desired result. Help him by finding out the correct command fromthe followings:

(i) Select count(*) from LOANS where name Like ‘Sharma%’;

(ii) Select count(*) from LOANS where name Like ‘%Sharma ’;

(iii) Select count( ) from LOANS where name like ‘%sharma ’;

(iv) Select count(Name) from LOANS where name ‘Sharma%’;

(d) State the command to display the maximum Loan_Amt and Cust_Name :-

(i) Select Max(Cust_Name, Loan_Amt) from LOANS;

(ii) Select Cust_Name, max(LoanAmt) from LOANS;

(iii) Select Cust_Name, max(Loan_Amount) from LOANS;

(iv) Select Cust_name, max(Loan_Amt) from LOANS;

(e) Help Ramesh to display the count of all loan holders whose interest is NULL.

(i) Select Count(*) from LOANS where Int_Rate is NULL.

(ii) Select Count() from LOANS where Interest is NULL.

(iii) Select Count(*) from LOANS where Int_rate = NULL;

(iv) Select Count( ) from LOANS where Interest = NULL;

Consider the following table Student & Stream.

Table: Student

Admno Sname Class Sec Fee Mobile Area S_ID
1001 RAMESH XII A 2500 987654321 Madipur 10
1078 KRISHNA XII B 2400 999911111 Jawala Heri 30
1006 FARDEEN XII C 2600 987654321 Paschim Puri 40
1004 SUBHAM XII A 2500 963025874 Madipur 20
1029 KRITIKA XI C 2700 987456210 Madipur 30
1008 SAMEEKSHA XII A 2450 987123456 Mangol Puri 20
1025 SALMA XII B 2580 998877445 Madipur 30
1036 AMANDEEP XII B 2600 999333555 Khyala 40
1037 TEJAS XI C 2650 987951357 Paschim Puri 40
1029 HIMANSHU XII A 2750 951369874 Jawala Heri 10

Table : Stream

S_ID Stream_name
10 MEDILCAL
20 NON MEDICAL
30 COMMERCE WITH MATH
40 COMMERCE WITH IP
50 HUMANITIES

Write SQL commands for the statements (a) to (h) on the above table: Student and Stream

(a) Identify Primary Keys and Foreign Key in the table student and primary key in Stream table given above.

(b) Display stream id and stream-wise total fee collected.

(c) Count no of students from each area.

(d) Display all the student details those who belongs to Madipur Area.

(e) Increase the fees of all students by10%.

(f) Display unique area from the student table.

(g) Display details of those students whose area contains ‘Puri’.

(h) Display the information of those students who are in class XII and section is either B or C.

Answer the following questions.

Table: Employee

No Name Salary Zone Age Grade Dept
1 Mukul 30000 West 28 A 10
2 Kritika 35000 Centre 30 A 10
3 Naveen 32000 West 40 20
4 Uday 38000 North 38 C 30
5 Nupur 32000 East 26 20
6 Moksh 37000 South 28 B 10
7 Shelly 36000 North 26 A 30

Table: Department

No DName MinSal MaxSal HOD
10 Sales 25000 32000 1
20 Finance 30000 50000 5
30 Admin 25000 40000 7

(a) Based on these tables write SQL statements for the following queries:

(i) Display the details of all the employees who work in Sales department.

(ii) Display the Salary, Zone, and Grade of all the employees whose HOD is Nupur.

(iii) Display the Name and Department Name of all the employees.

(iv) Display the names of all the employees whose salary is not within the specified range for the corresponding department.

(v) Display the name of the department and the name of the corresponding HOD for all the departments.

(b) Identify the Foreign Keys (if any) of these tables. Justify your choices.

Pawan is confused in understanding Dictionary concept. Help him to understand the concept by choosing the appropriate answer. (a) Which statement will display Not Available?
(i)Statement 9 (ii)Statement 10 (iii)Statement 11(iv)Statement 13
(b) Choose the key from Dictionary.
(i)ADMNO (ii)‘admno’ (iii)101 (iv)“Not Available”
(c) Which statement will display None?
(i)Statement 9 (ii)Statement 10 (iii)Statement 11(iv)Statement 13
(d) Which Statement will display Tejas?
(i) Statement 8 (ii) Statement 9 (iii) Statement 10 (iv) Statement 11
(e) Choose the identifier.
(i) ADMNO (ii) ‘admno’ (iii) setdefault (iv)Not Available
Given the following relation: STUDENT

Table: STUDENT

No. Name Age Department Dateofadm Fee Sex
1 Pankaj 24 Computer 10/01/97 120 M
2 Shalini 21 History 24/03/98 200 F
3 Sanjay 22 Hindi 12/12/96 300 M
4 Sudha 25 History 01/07/99 400 F
5 Rakesh 22 Hindi 05/09/97 250 M
6 Shakeel 30 History 27/06/98 300 M
7 Surya 34 Computer 25/02/97 210 M
8 Shikha 23 Hindi 31/07/97 200 F

Write SQL commands for the following queries

(a) To show all information about the students of History department.

(b) To list the names of female students who are in Hindi department.

(c) To list the names of all students with their date of admission in ascending order.

(d) To display student’s name, fee, age for male students only.

(e) To count the number of students with Age>23.

Consider the following tables CARHUB and CUSTOMER and answer (a) and (b) parts of this question: [Delhi 2012]

Table: CARHUB

Vcode Vehicle Name Make Color Capacity Charges
100 Innova Toyota WHITE 7 15
102 SX4 Suzuki BLUE 4 14
104 C Class Mercedes RED 4 35
105 A-Star Suzuki WHITE 3 14
108 Indigo Tata SILVER 3 12

Table: CUSTOMER

CCode CName VCode
1 Hemant Sahu 101
2 Raj Lal 108
3 Feroza Shah 105
4 Ketan Dhal 104

(a) Write SQL commands for the following statements:

(i) To display the names of all white colored vehicles

(ii) To display name of vehicle, make and capacity of vehicles in ascending order of their sitting capacity

(iii) To display the highest charges at which a vehicle can be hired from CARHUB.

(iv) To display the customer name and the corresponding name of the vehicle hired by them.

(b) Give the output of the following SQL queries:

(i) Select count(distinct make) from cabhub;

(ii) Select max(charges), min(charges) from carhub;

(iii) Select count(*), make from carhub;

(iv) Select vehiclename from carhub where capacity = 4;

Write the few negative points related to the usage of technology in our society.
Krishna is confused in Python code given below. Please help him to answer the following questions.

(a) Which line in the above code check for capital letter?

(b) Which line in the above code read the file “story. txt”?

(c) Which line in the above code does not affect the execution of program?

(d) Which line is the above code coverts capital letter to small letter?

(e) Which line is the above code opens the file in write mode?

(f) Which line is the above code saves the data?

(g) Which line(s) is/are the part of selection statement.

(h) Which line(s) is/are used to close story1.txt?

Oberoi Industries has set up its new center at Mangalore for its office and web-based activities. It has 4 blocks of buildings as shown in the diagram below:

Center to center distances between various blocks :

Block A to Block B 50 m
Block B to Block C 150 m
Block C to Block D 25 m
Block A to Block D 170 m
Block B to Block D 125 ill
Block A to Block C 90 m

Number of Computer:

Block A 25
Block B 50
Block C 125
Block D 10

(a) Suggest the device which is used to connect all the nodes in particular block.

(i) Repeater (ii) Gateway

(iii) Bridge (iv) Switch

(b) Suggest the most suitable wire to connect all the blocks with high-speed data transfer.

(i) Ethernet Cable (ii) Twisted Pair

(iii) Optical Fibre (iv) Co-axial Cable

(c) The organization is planning to link its front office situated in the city in a hilly region where cable connection is not feasible, suggest an economic way to connect way to connect it with reasonably high speed.

(i) Satellite (ii) Radio Wave

(iii) Microwave (iv) Bluetooth

(d) Suggest the appropriate protocol/way to do the audio-video communication between the different parts of the world.

(i) E-Mail (ii) Blog

(iii) Chat (iv) VOIP

(e) What type of network would be formed if the Mangalore office is connected to their New York office?

(i) LAN (ii) PAN

(iii) MAN (iv) WAN

Write the few points for the healthy use of technology.