0% found this document useful (0 votes)
11 views

Computer Science report file questions

Uploaded by

sadhvipandey2009
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Computer Science report file questions

Uploaded by

sadhvipandey2009
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Report Files Programs list

1. Write a program to check whether a number is a palindrome or not.


2. Write a program to receive two numbers in a function and return the result of all arithmetic operations (+,-,*,/,%) on
these numbers.
3. Write a random number generator program the generates random numbers between 1 and 6.
4. - Program to create a dictionary to store key value pairs of month and number of days. Then input the month and
from the user and display number of days in that month.
5. Write a program to input a character and to print whether a given character is an alphabet , digit or any other
character.
6. Write a program to read a text file and print only the sum of all the digits from the file.
7. Write a program to copy a file ‘source.txt’ to a file ‘target.txt’ except those lines starts with a letter ‘A’.
8. Write a program to create a function ‘STATISTICS()’ which will read a text file and display the number of vowels,
consonents, uppercase and lowercase letters in file.
9. Program to get roll numbers and marks of the students of a class and store these details in a file called ‘Marks.txt”.
10. Program to write roll number and name in a binary file student.dat.
11. Program to create a CSV file by storing some information then display all information on screen.
12. Program to create a function to calculate factorial of a number passed as an argument.
13. Write a function that takes two numbers and returns the number that has minimum One’s digit.
14. Program to implement a stack & perform & PUSH & POP operation.
15. Write Sql query to find the minimum, maximum, sum and average of the marks in a student table.
16. Write Sql query to find the total number of customers from each country in the table customer(customer ID,
customer name, country) using group by.
17. Write a program to connect Python with MySQL using database connectivity and perform the following operations:
Create a table STUDENT in Database SCHOOL with following structure
Stu_no int Primary Key
Sname varchar(25)
Stream varchar(10)
Percent float(4,2)

After creating the following table insert a record in the table

Q 18) Write a function in python Push(Arr),Where Arr is the list of numbers divisible by 5 into a stack
implemented by using a list. Display the stack if it has at least one element, otherwise display
appropriate message.

Q19) In a database, there are two tables given below:


Table Employee

Table Job
Write SQL queries for the following
(i) To display employee ids, names of employees, job ids with corresponding jobtitles.
(ii) To display names of employees,sales and corresponding job titles who have achieved
sales more than 1300000.
(iii) To display names and corresponding job titles of those employees who have Singh
(anywhere) in there names.
(iv) Identify foreign key in the table.
(v) Write SQL command to change the JOBID to 104 of the Employee with ID as E4 in the table
Employee .

Q 20) In the given table ‘student’ write SQL queries to perform following operations.

Table : Student

(i) Add a new field (column name school_name )of datatype varchar(50)
(ii) Update the table by updating school _name as ‘ABC Public School’
(iii) Display the all the records by increasing order of class
(iv) Delete all the records where game is ‘basketball’
(v) Display total number of students of every game individually

Q 21) Consider the following tables. Write SQL commands for the statements (i) to (v).

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

Table :RECIPIENT
RecID SenderID RecName RecAddress RecCity
KO05 ND01 R Bajpayee 5, Central Avenue Kolkata
ND08 MU02 S Mahajan 116, A Vihar New Delhi
MU19 ND01 H Singh 2A, Andheri East Mumbai
MU32 MU15 P K Swamy B5, C S Terminus Mumba
ND48 ND50 S Tripathi 13, B1 D, New Delhi
Mayur Vihar

(i) To display the names of all Senders from Mumbai.


(ii) To display the RecID, SenderName, SenderAddress, RecName, RecAddress for every Recipient.
(iii) To display Recipient details in ascending order of RecName.
(iv) To display number of Recipients from each City.
(v) To display the detail of recipients who are in Mumbai.

Q 22) In the given table ‘student’ write SQL queries to perform following operations.

Table : Student

(i) To display all game names only once


(ii) To display name of all the students whose names starts with ‘A’
(iii) To display the names of students who are getting a grade ‘C’ in either Game or Supw
(iv) To insert the following record in table student
(16,9,’Bipluv’,’Cricket’,’A’,’Cooking’,’A’)
(v) To add a column Wing varchar(10) in table student

Q 23) Find output for SQL queries (i) to (iv), which are based on tables TRANSPORT and TRIP.

Table : TRANSPORT

Table : TRIP
(i) SELECT SUM(KM) WHERE TRIP.TCODE>=104;
(ii) SELECT COUNT(*), TCODE FROM TRIP GROUP BY TCODE HAVING count(*)>1;
(iii) SELECT DISTINCT(TCODE) FROM TRIP;
(iv) SELECT A.TCODE,NAME,TTYPE FROM TRIP A, TRANSPORT B WHERE A.TCODE=B.TCODE AND KM<90;
(v) SELECT NAME, KM*PERKM FROM TRIP A, TRANSPORT B WHERE A.TCODE=B.TCODE AND A.TCODE=105;

Q 24) #program to connect Python with MySQL using database connectivity and perform the following
operations:
Display all records or individual record of table STUDENT in Database SCHOOL with following structure
Stu_no int Primary Key
Sname varchar(25)
Percent int

Q 25) #Program to connect python to mysql using database connectivity and update Sname of table
STUDENT in database SCHOOL.

Q 26) #Program to connect python to mysql using database connectivity and delete record of a student
From table STUDENT in database SCHOOL.

You might also like