0% found this document useful (0 votes)
12 views1 page

Sample PRACTICAL PAPER Cs

The document contains a series of practical exercises for a Computer Science course, focusing on programming tasks in Python and SQL database operations. Exercises include implementing stack operations, creating and querying MySQL tables, and handling data in binary and CSV files. Students are required to write code for various data manipulation tasks, including filtering and aggregating data based on specified criteria.

Uploaded by

Naruto Uzumaki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Sample PRACTICAL PAPER Cs

The document contains a series of practical exercises for a Computer Science course, focusing on programming tasks in Python and SQL database operations. Exercises include implementing stack operations, creating and querying MySQL tables, and handling data in binary and CSV files. Students are required to write code for various data manipulation tasks, including filtering and aggregating data based on specified criteria.

Uploaded by

Naruto Uzumaki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SAMPLE PRACTICAL exercises.

SUBJECT: Computer Science (083)


Q1. Write a program using user defined functions to show the PUSH,POP,TRAVERSE operation in a stack containing
percentage of students of a class using a List in Python.
Q2.Create the following Table ‘ITEMS’ in PQR database in MySQL :
code Player Runs
P1 AMIT 2500
P2 MAC 1101
P3 Rohan 500
P4 Sachin 15000
Now write a python code to connect table ITEMS and display the player names who have more than 1000 runs.

Q2. Write a program in python using user defined functions to do following using functions:
 Create and store name,percentage of 4 students binary file ‘a.dat’
 Read the file Display the students information scoring percentage above 90.
Q3. Write a program in python using user defined functions to do following using functions:
 Create and store name,percentage of 4 students csv file ‘a.csv’
 Read the file Display the students information scoring percentage above 90.

Q4.Create the following Table ‘emp’ in ABC database in MySQL :


code ename salary
P1 mohit 12000
P2 ratna 14590
P3 Rajni 50000
P4 Sachin 15000
Now write a python code to connect table emp and count the employees having salary between 10000 and 12000(inclusive
both ends).

Q5.Look the following Table ‘EMP and answer the questions that follows:

CODE ENAME SALARY dept


P1 Mohit 12000 Finance
P2 Ratna 14590 Adm
P3 Rajni NULL Finance
P4 Sachin 15000 Adm

Now write SQL statement for (i) –(iii) and give output for iv)-(v)
i) Display the names in descending order of salary.
ii) Count the number of unique departments.
iii) Display the player name where name contains letter ‘A’ and salary above 10000.
Give output:
iv) SELECT dept,AVG(RUNS) FROM PLAYER GROUP BY dept;
v) SELECT ENAME FROM emp WHERE eNAME LIKE ‘%N%’ AND salary IS NULL;

Q6. Write a program, with separate user defined functions to perform the following operations:
● Push the keys (name of the student) of the dictionary into a stack, where the corresponding value (marks) is greater than
75.
● Pop and display the content of the stack.
Q7. Following Table ‘PLAYER in in MySQL contains below information :
CODE NAME RUNS TEAM
P1 AMIT 2500 A
P2 MAC 1101 B
P3 Rohan 500 A
P4 Sachin NULL B
Now write SQL statement for (i) –(iii) and give output for iv)-(v)
i) Display the player information in descending order of Runs.
ii) Count the number of unique teams.
iii) Display the player name where player name contains letter ‘A’
Give output:
iv) SELECT TEAM,AVG(RUNS) FROM PLAYER GROUP BY TEAM;
v) SELECT NAME FROM PLAYER WHERE NAME LIKE ‘%N’ AND RUNS IS NULL;

You might also like