Board practcal_Questions cs
Board practcal_Questions cs
M : 30
Set – 1
Q.1 Execute a program on your Machine and after successful execution make the word file with
all the possible outputs and take out the print outs [8]
To store marks out of 100 in Eng, Maths, Phy, Chem, CS of 10 students of your class in binary
file ‘12CS.dat’ , then give option to display all records , display the names of students who got
distinction in each subject one after another.
Q.2 Consider the following tables Product and Client. [4]
Table : Product Table : Client
P_ID ProductName Manufacturer Price C_ID ClientName City P_ID
TP01 Talcom Powder LAK 40 01 Cosmetic Shop Delhi FW05
FW05 Face Wash ABC 45 06 Total Health Mumbai BS01
BS01 Bath Soap ABC 55 12 Live Life Delhi SH06
SH06 Shampoo XYZ 120 15 Pretty Woman Delhi FW12
FW12 Face Wash XYZ 95 16 Dreams Banglore TP01
With reference to these tables, execute and write commands in SQL for the questions given
below:
(a) To display all the details of products bought by the clients.
(b) To display the Client name, City , Product Name and Price where Product name
Has The letter ‘a’ as the second character.
(c) Increase the price of the products by 20% where price is less than 50.
(d) To delete ‘Pretty Woman’ record from table ‘Client’
Note:- Save your program with your firstname.py . In comment write your Name, CBSE roll
No , brief of the question , Machine no. After successful execution of the program paste the
screenshot of program and all its possible outputs in your word file which is to be saved with
your firstname.docx.
Set – 2
Q.1 Execute a program on your Machine and after successful execution make the word file with
all the possible outputs and take out the print outs [8]
First create A file ‘Story.txt’ in notepad which contains any random text . Write a program in
Python to copy all lines that contain the character ‘a’ from this file and write them in another
file “Story2.txt”.
Q.2 Study the following tables DOCTOR and SALARY and write SQL commands to create
the table and insert contents in it(no need to write queries to do so in answer sheet) but write the
queries that follow :- [4]
TABLE : DOCTOR
ID NAME DEPT SEX EXPERIENCE
101 JOHN ENT M 12
104 SMITH ORTHPEDIC M 5
107 GEORGE CARDIOLOGY M 10
114 LARA SKIN F 3
109 K GEORGE MEDICINE F 9
105 JOHNSON ORTHPEDIC M 10
117 LUCY ENT F 3
111 BILL MEDICINE F 12
130 MORPHY ORTHPEDIC M 15
TABLE : SALARY
ID BASIC ALLOWANCE CONSULTATION
101 12000 1000 300
104 23000 2300 500
107 32000 4000 500
114 12000 5200 100
109 42000 1700 200
105 18900 1690 300
130 21700 2600 300
(i) Display NAME of all doctors who are in “MEDICINE” having more than 10 years
experience from the table DOCTOR.
(ii) Display the average salary of all doctors working in “ENT” department using the table
DOCTOR and SALARY when salary = BASIC + ALLOWANCE.
(iii) Display the minimum ALLOWANCE of female doctors.
(iv) Display the highest CONSULTATION fee among all male doctors.
Note:- Save your program with your firstname.py . In comment write your Name, CBSE roll No
, brief of the question , Machine no. After successful execution of the program paste the
screenshot of program and all its possible outputs in your word file which is to be saved with your
firstname.docx.
Set – 3
Q.1 Execute a program on your Machine and after successful execution make the word
file with all the possible outputs and take out the print outs [8]
Write a script in Python to increase the salary by Rs 20000/- of the employee having employee
id as 1251 in the file ‘emp1.dat’ containing 5 records of employee_id , name , designation and
salary
Q.2 Consider the following tables LIBRARY and PUBLISHER (create and insert records first
but no need to write the queries of it in answer sheet) : [4]
Table: LIBRARY
ACCNO TITLE PUBCODE TYPE NOC NOI PRICE
301 My first C++ 101 TEXT 5 3 325
041 Fast cook 102 COOKERY 4 2 450
083 The tears 101 FICTION 6 6 800
042 Thunderbolts 102 FICTION 3 2 650
043 C++ brainworks 103 TEXT 4 2 300
034 Ques Bank 104 TEXT 10 10 250
Table: PUBLISHER
PUBCODE CONT_PER PHNO GENDER
101 P.Jain 25678345 MALE
102 R.Nagpal 25555555 MALE
103 Supatra 26666666 FEMALE
104 Sumita 27777777 FEMALE
Note:- Save your program with your firstname.py . In comment write your Name, CBSE roll No
, brief of the question , Machine no. After successful execution of the program paste the
screenshot of program and all its possible outputs in your word file which is to be saved with your
firstname.docx.
Set – 4
Q.1 Write a program in Python to do the following:- [8]
a) UDF Push() to add Mark of a student in a STACK ,
b) UDF Pop() to delete Mark of a student from a STACK of Student’s Marks.
c) Call PUSH function as per user’s choice and POP all Student’s Marks from the
STACK.
Q.2 Study the following tables and write SQL commands for the queries that follow(create
and insert records first but no need to write the queries of it in answer sheet) :- [4]
TABLE : RECIPIENT
RecID SenderID RecName RecAddress RecCity
KO05 ND01 R Bajpayee 5,Central Avenue Kolkata
ND08 MU02 S Mahajan 116, Ashok Vihar New Delhi
MU19 ND01 H Singh 2A, Andheri East Mumbai
MU32 MU15 P K Swamy B5, C S Terminus Mumbai
ND48 ND50 S Tripathy 13, B1-D, Mayur Vihar New Delhi
TABLE : SENDER
SenderID SenderName SenderAddress SenderCity
ND01 R Jain 2, ABC Appts New Delhi
MU02 H Sinha 12, Newtown Mumbai
MU15 S Jha 27/A, Park Street Mumbai
ND50 T Prasad 122-k, SDA New Delhi
Note:- Save your program with your firstname.py . In comment write your Name, CBSE roll No
, brief of the question , Machine no. After successful execution of the program paste the
screenshot of program and all its possible outputs in your word file which is to be saved with your
firstname.docx.
Set – 5
Q.1 Execute a program on your Machine and after successful execution make the word
file with all the possible outputs and take out the print outs [8]
Motive of the Program is to create a csv file ‘sports.csv’ contains information of a sports meet
in your school i.e AdmNo , Participant_Name , Game . Write a script in Python to display
details of all participants taking part in ‘Cricket’ from ‘sports.csv’ . Also display all records of
‘sports.csv’ on screen.
Q.2 Consider the following tables EMPLOYEES and EMPSALARY (create and insert records
first but no need to write the queries of it in answer sheet) : [4]
Table :- Employees
Empid Firstname Lastname Address City
010 Ravi Kumar Raj Nagar GZB
105 Harry Waltor Gandhi Nagar GZB
152 Sam Tones 33 Elm St. Paris
215 Sarah Ackerman 440 U.S 110 Upton
244 Manilla Sengupta 24 friends street New Delhi
300 Robert Samuel 9 Fifth Cross Washington
335 Ritu Tandon Shastri Nagar GZB
400 Rachel Lee 121 Harrison St. New York
441 Peter Thompson 11 Red Road Paris
311 Sonika Thapar 10,Janpath New Delhi
Table :- EmpSalary
Empid Salary Benefits Designation
010 75000 15000 Manager
105 65000 15000 Manager
152 80000 25000 Director
244 50000 12000 Clerk
300 45000 10000 Clerk
335 40000 10000 Clerk
400 32000 7500 Salesman
311 7500 5000 Peon
Write the SQL commands for the following using above tables :-
(i) To display Empid , FirstName , Salary who are ‘Manager’
(ii) To display designation and the frequency of employees designation wise.
(iii)To List the names(Firstname and Lastname) of those employees only whose name starts with ‘R’
(iv)To add a new column in EmpSalary table i.e Total_Sal
Note:- Save your program with your firstname.py . In comment write your Name, CBSE roll No
, brief of the question , Machine no. After successful execution of the program paste the
screenshot of program and all its possible outputs in your word file which is to be saved with your
firstname.docx.