0% found this document useful (0 votes)
12 views6 pages

revision_questions-board_practical_exam[1]

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

DELHI PUBLIC SCHOOL BANGALORE SOUTH

REVISION QUESTIONS
SSCE PRACTICAL EXAMINATION (2025)
SUBJECT: COMPUTER SCIENCE (083)

MAX.MARKS:30 DURATION: 3 HRS

Note:
1.Use input() to accept values. All programs should use functions (user defined).
2.Verify the file created/ modified on your computer for questions based on text/binary/csv files.

Question 1: Python code with comments and output – of one sample input
Question 2: Write SQL commands:
 to create a database in your name; to create the table ;
 to add the first row and 4 queries as mentioned in the question.

Marks Split up:


1. Python program - 8
2. SQL -4
2 Report file - 7
3 Project - 8
4 Viva voce - 3

Question 1
1. Write a Python program to:
a. Accept a range of numbers and save all prime numbers within the range into a list. Save the
list on the file: PRIMES.DAT
b. Read the file and display all prime numbers below 150. If there are none, print “NO DATA”.

2. Write a Python program to input ‘n’ rows and save them in the csv file:patient.csv. A sample
is shown below.

No Name Age Department Dateofadmin Charges


1 ABC 62 NEPHROLOGY 21/01/2023 800
2 DEF 18 ENT 12/12/2023 650
Compute and display Number of patients in a department, input by the user.
3. Write a Python program to accept name and date of joining of ‘n’ students. Store the data of
each student in the form of a tuple. Example: (‘abc’,’01-08-2019’). Date must be entered in the
format: dd-mm-yyyy. Store all tuples in:STUD.DAT. Read the file and display details of students
whose names start with “P” or “T”.
4. Define a function stud(n), that accepts the number of students (n) and creates a csv file:
STUD.CSV, having: [name, average_marks, employed]. Compute the number of employed and
un employed students, excluding those whose average_marks is below 60.

5. Write a Python program to store ‘n’ student names (first name, last name) in the text file:
NAMES.TXT. Each line shall contain: first name,last name.
i)Accept last name from the user and display all names having the same last name or display
NOT FOUND
ii)Display all first names in alphabetical order.
6. Create a python program to write ‘n’ lines into the text file: sample.txt. Create another text
file :new.txt, by deleting the words “a”, “the”,”an”.

7. Create a binary file: event.dat, to store ‘n’ records each containing information of an event
in the form of a dictionary, as given below.
,‘name’: “event name”, “date” :”10/10/2019”, “cost”:12345-
Accept a choice and display all records whose cost is in the range 10000 and 20000, in a
tabular form.

8. Create a binary file: news.dat, store ‘n’ dictionaries (containing details of newspaper) as
given below.

Key Value type


name String
language String
founded Int
publication String: daily/weekly/monthly
Display a list of all names of those which are published monthly.

9. Create a CSV file: PYTHON PROGRAM.CSV to store the data in the following format.
Class Topic SEGMENT Marks assigned
8 Sustainable development goals AI 5
9 Neural Network AI 10
10 Introduction to python PYTHON 5
11 Data Handling in python PYTHON 5
12 File handling PYTHON 15
Compute Average marks allocated to a given segment.
10.Write a python Python program to create the csv file: MARKS.CSV in the above format. Test value
must be : positive integer between -50 and 50 . Selected will have 1, if the average score is 25 or
above. Read the file and print the total number of candidates who are selected.
Marks.csv
CANDIDATE TEST1 TEST2 TEST3 TEST4 AVERAGE Selected
NAME
11. Write a Python program to accept and store: employee number, employee name , in a
list. Perform following operations by implementing a stack. Display top element.

1. Insert an element
2. Delete an element
3. Display
4. Exit
Sample stack: * *1,”Josh”+,* 2,”Rohan”++

Question 2

1. Create the tables given below, in MySql and insert values. Write queries for (i) to (iv).
TABLE: TRAINS

TABLE: PASSENGERS

(i) To display details of all Trains which Start from New Delhi.
(ii) To display the PNR, PNAME, GENDER and AGE of all Passengers whose AGE is below 35.

(iii) To display total number of MALE and FEMALE Passengers.

(iv) To display details of all Passengers travelling in Trains whose TNO is 12015.
2. Create the table given below, in MySql and insert values. Write queries for (i) to (iv):

i) To display details of those Faculties whose salary is greater than 12000.


ii) To display the details of courses whose fees is in the range of 15000 to 50000 (both values
included).
iii) To increase the fees of all courses by 500 of “System Design” Course.
iv) To display details of those courses which are taught by ‘Sulekha’ in descending order of
courses.

3.Create the table given below, in MySql and insert values. Write queries for (i) to (iv):

PATIENT

No Name Age Department Date of Charge


1 ARUN KUMAR 56 Cardiology 15/03/2018
Admission 500
2 PRIYA SHARMA 29 Neurology 10/8/2017 600
3 VIKRAM SINGH 40 Orthopedic 25/07/2019 700
4 DIVYA 33 Dental 12/1/2021 400
5 MANOJ
AGARWAL 48 Surgery 20/11/2022 900
6 RAHUL
VERMA 37 ENT 5/5/2020 850
7 AARAV
MISHRA 65 Pediatrics 30/09/2016 750
SHARMA
a) Change the department of HARISH to Cardiology
b) Display all patients charged above 300.
c) Display name and age of patients who belong to ENT department.
d) Display total number of patients in each department. Display the result in alphabetical
order(department).

4.Create the table given below, in MySql and insert values. Write queries for (i) to (iv):
TABLE: BANK
Acc_no Cname Bname Amount Dateofopen T_Transactions
1 Anirban State bank of India 17000 15/7/2019 35
2 Yatin State bank of India 38000 10/02/2019 41
3 Amit Axis bank 51000 10/02/2021 25
4 Rakshit Punjab national bank 26000 10/02/2023 10
5 Rashmi State bank of India 45000 10/02/2017 56
6 Yatin Axis bank 71000 10/02/2018 21
7 Shreya ICICI 600000 10/02/2012 51

i) Display data for those customers whose amount is less than 25000,sorted by their
dateofopen.
ii) List the minimum,maximum amount from the bank.
iii) Display all unique bank names.
iv) Display total number of transactions for each bank if the number is more than 70.

5. Create the table given below, in MySql and insert values. Write queries for (i) to (iv):
PRODUCT
P_ID PRODUCTNAME MANUFACTURER PRICE
P001 MOISTURISER DOVE 40
P002 SANITIZER DETTOL 25
P003 BATH SOAP LUX 35
P004 DETTOL LIQUID DETTOL 75
P005 LIQUID DETERGENT SURF 250
P006 CLEANING BRUSH EXO 180
P007 TOOTH BRUSH COLGATE 40
a) Delete all rows whose manufacturer is LAC.
b) Display all records in ascending order of price.
c) Display number of products of each manufacturer.
d) Display product and manufacturer in alphabetical order of product.

6. Create the table given below, in MySql and insert values. Write queries for (i) to (iv):

Table:Zoo

Animalid Aname Species Origin price

1 Tiger Mammal India 10000


2 Peacock Bird India 5000
3 Zebra Mammal Africa 8000
4 Ostrich Bird Australia 6000
5 Owl Bird NULL 2000
6 Hippopotamus Mammal India 5000
7 Crocodile Reptile Africa 7000
(i) Display the Aname, Species and price whose price is in range 8000 to 10000.
(ii) Display the Aname, Species and Origin whose origin is India.
(iii) Display Animalid, name and origin of all birds in alphabetical order of name.
(iv) Change all NULLs under origin to Africa.

7. Create the table given below, in MySql and insert values. Write queries for (i) to (iv):
Table : CLUB

Mcode Mname Gender Age Fees Type


1 Ashish M 25 6550 Monthly
2 Madhulika F 29 7124 Monthly
3 Niti Singh F 31 18000 Yearly
4 Pratyush M 55 1200 Quarterly
5 Venus Sah F 19 7600 Monthly
6 Anand Seth M 45 19500 Life
i) Display Mname, age & fees of those club members whose fees is between 10000 to 15000.
ii) Delete all rows whose fees exceed 7000.
iii) Display Mcode, Mname & Type of all female members with age in descending order.
iv) Display the total fees of the male and female members separately in a single command

8. Create the table given below, in MySql and insert values. Write queries for (i) to (iv):
Teacher

NO NAME AGE DEPARTMENT DATE OF JOINING SALARY


1. ARYA PRASAD 38 COMPUTER 10/01/2017 12000
2. SAYONI 36 HISTORY 24/03/2018 20000
3. SANDEEP SINGH 32 MATHS 12/12/2016 30000
4. Shyam 50 History 27/02/2017 30000
5. jigal 34 Computer 10/01/2017 12000
6. Sharmila 31 History 24/03/2018 20000
7. Sandeep Sharma 32 Maths 12/12/2019 30000
(i) Display the number of teachers in each department, who are aged above 35.
(ii) Add a new column : gender, to store Male/Female
(iii) To list the names of female teachers who are in Maths department
(iv) Display count of teachers with age<35

You might also like