Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

II TERMINAL PRACTICAL EXAMINATION - 2023

COMPUTER SCIENCE (083)


Date: Max Marks: 30
Batch No : Roll and Name:
SET - 1
S.no QUESTION Marks

1. Write a program to create a dictionary containing COUNTRY names (keys) and 8


CONTINENTS(values) of 5 COUNTRIES, with separate user defined functions to
perform the following operations:
● Push the keys (name of the Country) of the dictionary into a stack L, where
the corresponding value (continent) is ‘ASIA’.
● Pop and display the content of the stack.
For example: If the sample content of the dictionary is as follows:
R={‘Kenya’: ‘Africa’, ‘Japan’ : ‘Asia’ , ‘France’ : ‘Europe’, ‘India’ : ‘Asia’, ‘
Zimbabwe’ : Africa’, ‘Malaysia’ : ‘Asia’ }
The output from the program should be: Malaysia India Japan
2. Create the following table CABHUB, CUSTOMER and write SQL Commands for 4
questions (i)to(iii) output for SQL query (iv) and (v)
CABHUB
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 Innova Tata silver 3 12

CUSTOMER
CCODE CNAME VCODE
1 Hemant Sahu 101
2 Raj Lal 108
3 Feroza Shah 105
4 Ketan Dhal 104

i) To display vehicle name, make, capacity of vehicles in ascending order of


their capacity.
ii) To display highest charges for which vehicle can be hired from CABHUB.
iii) To display the customer name and corresponding vehicle name hired by them.
iv) SELECT COUNT(DISTINCT make) FROM CABHUB;
v) SELECT COUNT(*), make FROM CABHUB GROUP BY make;

3. Record 7
4. Project 8

5. Viva 3
Total 30
II TERMINAL PRACTICAL EXAMINATION - 2023
COMPUTER SCIENCE (083)
Date: Max Marks: 30
Batch No : Roll and Name:
SET - 2
sl.no QUESTION Marks
1. Write a program in python using user defined function to perform the following operations 8
LongLines( ) which reads the contents of a text file named LINES.Txt and displays
those lines from the file which have atleast 10 words in it.
CountVowels( ) to read Lines.txt and print the count of vowels
2. Create the following two tables Employees , Empsalary and write SQL Commands for 4
questions (i)to(iii) output for SQL query (iv) and (v).

(i) To display the content of EMPLOYEES table in descending order of FIRSTNAME.


(ii) To display the Firstname, Lastname, and Total Salary of all Managers from tables
EMPLOYEES and EMPSALARY, where Total Salary is calculated as Salary + Benefits.
(iii) To display maximum and minimum salary among Managers and Clerks from the table
EMPSALARY.
(iv) SELECT COUNT(DISTINCT DESIGNATION) FROM EMPSALARY;
(v) SELECT DESIGNATION, SUM(SALARY) FROM EMPSALARY GROUP BY
DESIGNATION HAVING COUNT(*)>2;
3. Record 7

4. Project 8

5. Viva 3

Total 30
II TERMINAL PRACTICAL EXAMINATION - 2023
COMPUTER SCIENCE (083)
Date: Max Marks: 30
Batch No : Roll and Name:
SET - 3
S.no QUESTION Marks

1. Write a program to remove all the lines that starts with character ‘A’ in a file 8
(AI.txt) and write it to another file. (AI_new.txt)
AI.txt

AI_new.txt
It is the intelligence of machines.
With AI, machines can perform reasoning and problem solving.
It is the development in the world of technology.
2. Create the following table STATIONERY, CONSUMER and write SQL Commands 4
for questions (i)to(iii) output for SQL query (iv) &( v)
STATIONERY
S_ID S_NAME COMPANY PRICE
DP01 DOT PEN ABC 10
PL02 PENCIL XYZ 6
ER05 ERASER XYZ 7
PL01 PENCIL CAM 5
GP02 GEL PEN ABC 15

CONSUMER
C_ID CNAME ADDRESS S_ID
GOOD PL01
01 LEARNER CHENNAI
06 WRITE WELL MUMBAI GP02
12 TOPPER CHENNAI DP01
15 WRITE & DRAW CHENNAI PL02
16 MOTIVATION BANGALORE PL01
i) To display the details of stationery whose price is in the range of 5
to 10 (both value included).
ii) To display consumer name, address from table consumer along with price
from table stationery with corresponding matching S_ID.
iii) To increase the price of all stationery by 2.
iv) SELECT DISTINCT Address FROM consumer;
v) SELECT company, max(price), min(price), count(*) from stationery
group by company;
3. Record 7
4. Project 8
5. Viva 3
Total 30
II TERMINAL PRACTICAL EXAMINATION - 2023
COMPUTER SCIENCE (083)
Date: Max Marks: 30
Batch No : Roll and Name:
SET - 4
S.n QUESTION Marks
o
1. 8

2. Create the following tables GRADUATE & GUIDE 4


GRADUATE
SL.NO NAME STIPEND SUBJECT AVG DIVISION

1 KARAN 400 PHYSICS 78 1


COMPUTER
2 DIWAKAR 450 SCIENCE 95 1
3 DIVYA 300 CHEMISTRY 80 2
4 ARUN 350 PHYSICS 68 1
5 SABINA 500 MATHEMATICS 85 1
GUIDE
MAIN_AREA ADVISOR
PHYSICS VINOD
COMPUTER SCIENCE ALOK
MATHEMATICS RAJAN
CHEMISTRY MAHESH

Write SQL commands for the statements (i) to (iii)


i) List the names of students in division 1 sorted by name.
ii) Count the no of students either in physics or chemistry.
iii) Display name from graduate who have taken physics and name ending with ‘A’
Give the output for SQL query iv and v.
iv)Select count(distinct subject) from graduate;
v)Select name, advisor from graduate, guide where graduate.subject =
guide.main_area;

3. Record 7

4. Project 8

5. Viva 3

Total
30
II TERMINAL PRACTICAL EXAMINATION - 2023
COMPUTER SCIENCE (083)
Date: Max Marks: 30
Batch No : Roll and Name:
SET - 5
S.no QUESTION Marks

1. 8

2. Create the following table CABHUB, CUSTOMER and write SQL Commands for 4
questions (i)to(iii) output for SQL query (iv) and (v)
CABHUB
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 Innova Tata silver 3 12
CUSTOMER
CCODE CNAME VCODE
1 Hemant Sahu 101
2 Raj Lal 108
3 Feroza Shah 105
4 Ketan Dhal 104

i) To display vehicle name, make, capacity of vehicles in ascending


order of their capacity.
ii) To display highest charges for which vehicle can be hired from
CABHUB.
iii) To display the customer name and corresponding vehicle hired by
them.
iv) SELECT COUNT(DISTINCT make) FROM CABHUB;
v) SELECT COUNT(*), make FROM CABHUB GROUP BY make;
3. Record 7
4. Project 8
5. Viva 3

Total 30
II TERMINAL PRACTICAL EXAMINATION - 2023
COMPUTER SCIENCE (083)
Date: Max Marks: 30
Batch No : Roll and Name:
SET - 6
S.no QUESTION Marks

1. Write python program for the following:- 8

2. Create the following table STATIONERY, CONSUMER and write SQL Commands for 4
questions (i)to(iii) output for SQL query (iv) &( v)
STATIONERY
S_ID S_NAME COMPANY PRICE
DP01 DOT PEN ABC 10
PL02 PENCIL XYZ 6
ER05 ERASER XYZ 7
PL01 PENCIL CAM 5
GP02 GEL PEN ABC 15

CONSUMER
C_ID CNAME ADDRESS S_ID
GOOD PL01
01 LEARNER CHENNAI
06 WRITE WELL MUMBAI GP02
12 TOPPER CHENNAI DP01
15 WRITE & DRAW CHENNAI PL02
16 MOTIVATION BANGALORE PL01
iii) To display the details of stationery whose price is in the range of 5 to 10
(both value included).
iv) To display consumer name, address from table consumer along with price
from table stationery with corresponding matching S_ID.
vi) To increase the price of all stationery by 2.
vii) SELECT DISTINCT Address FROM consumer;
viii) SELECT company, max(price), min(price), count(*) from stationery
group by company;
3. Record 7

4. Project 8

5. Viva 3

Total
30
I TERMINAL PRACTICAL EXAMINATION - 2023
COMPUTER SCIENCE (083)
Date: Max Marks: 30
Batch No : Roll and Name:
SET - 7
S.n QUESTION Marks
o
1. 8

2. Create the following tables GRADUATE & GUIDE 4


GRADUATE
AV
SL.NO NAME STIPEND SUBJECT DIVISION
G
1 KARAN 400 PHYSICS 78 1
COMPUTER
2 DIWAKAR 450 SCIENCE 95 1
3 DIVYA 300 CHEMISTRY 80 2
4 ARUN 350 PHYSICS 68 1
5 SABINA 500 MATHEMATICS 85 1
GUIDE
MAIN_AREA ADVISOR
PHYSICS VINOD
COMPUTER SCIENCE ALOK
MATHEMATICS RAJAN
CHEMISTRY MAHESH

Write SQL commands for the statements (i) to (iii)


i) List the names of students in division 1 sorted by name.
ii) Count the no of students either in physics or chemistry.
iii) Display name from graduate who have taken physics and name ending with ‘A’
Give the output for SQL query iv and v.
iv)Select count(distinct subject) from graduate;
v)Select name, advisor from graduate, guide where graduate.subject = guide.main_area;

3. Record 7

4. Project 8

5. Viva 3

Total 30

You might also like