Professional Documents
Culture Documents
PRACTICAL FILE
2. Write a program to take an input from the user and display whether the number 2
is odd or even.
3. Write a program to input marks in 5 different subjects and calculate their 3
percentage.
4. Write a program to enter name and age of person and display whether the person 4
is eligible to vote.
5. Write a program to find out Fibonacci series up to a certain number. 5
6. Define the function to find the factorial of a number and use that function in a 6
program
7. Write a program that searches for prime number from 15-25 7
8. Write a program to input 3 numbers and display the largest number. 8
9. Write a program to check whether the year entered by the user is a leap year or not. 9
10. Write a program to find sum of digits of number entered by the user. 10
11. Write a program to find the grade of a student. If a child score 90% A grade, 80%-90% B 11
grade, 70%-80% C grade, 60%-70 D grade and below 60% fail.
12. Write a program to input two strings. If string 1 is contained in string 2 then create a third 12
string which contains the first four characters of string 2.
13. Write a program to input a string and check whether it is palindrome or not. 13
14. Write a program that reads a line and then prints number of uppercase and lowercase 14
characters.
15. Write a program to input a string with some digits and then print sum of the digits. 15
16. Write a program to input a tuple and create two new types from it, one containing its 16
every third element in reverse order, starting from the last element, other containing
every alternate element from third to ninth.
17. Write a program to input a tuple and check if it contains all the elements as same. 17
18. Write a program to check whether all elements of the tuple are in descending order or 18
not.
19. A tuple stores marks of 5 subject of a student. Write a program to find the grade of a 19
student.
20. Write a program to input n names from a student. Also input a name of a student from 20
the user and find if it’s in the tuple or not.
21. Write a program to delete keys of a dictionary one by one in LIFO order. Make sure there 21
is no error generated in when the last item is deleted.
22. Write a program to find highest two values in a dictionary. 22
23. Write a program to create a dictionary from a string. 23
24. Write a program that displays options for inserting and deleting elements from a list. If 24
the user chooses a deletion option display a submenu and ask if the element is to be
deleted by value or by using its slice is to be deleted.
25. Write a program to find minimum element of a list along with its index. 25
INPUT
OUPUT
Q.2 Write a program to take an input from the user and display whether the
entered number is odd or even.
OUTPUT
INPUT
Q.3 Write a program to input marks in 5 different subjects and calculate their
percentage.
INPUT
OUTPUT
Q.4 Write a program to enter age and name of person and display the
message whether the person is eligible to vote or not.
INPUT
OUTPUT
Q.5 Write a program to find out Fibonacci series up to a certain number.
INPUT
OUTPUT
Q.6 Define the function to find the factorial of a number and use the function
in a program.
INPUT
OUTPUT
Q.7 Write a program that searches for prime number between 15 to 25.
INPUT
OUTPUT
Q.8 Write a program to input 3 numbers and display the largest number.
INPUT
OUTPUT
Q.9 Write a program to check whether the year entered by the user is leap
year or not.
INPUT
OUTPUT
Q.10 Write a program to find sum of digits of number entered by the user.
INPUT
OUTPUT
Q.11 Write a program to find grade of a student. If a child is getting above
90% A grade, 80%-90% B grade, 80%-70% C grade, 70%-60% D grade and
below 60% fail.
INPUT
OUTPUT
Q.12 Write a program to input two strings, if string 1 is contained in string 2,
then create a third string with first four characters of string 2 would restore.
INPUT
OUTPUT
Q.13 Write a program to input a string and check whether it is palindrome or
not.
INPUT
OUTPUT
Q.14 Write a program that reads a line and then prints number of uppercase,
lowercase characters and digits.
INPUT
OUTPUT
Q.15 Write a program to input a string with some digits and find the sum of
those digits.
INPUT
OUTPUT
Q.16 Write a program to input a tuple and create two new types from it, one
containing its every third element in reverse order, starting from the last
element, another containing every alternate element between third to ninth
element.
INPUT
OUTPUT
Q.17 Write a program to input a tuple and check if it contains all elements as
same.
INPUT
OUTPUT
Q.18 Write a program to check if all the elements of a tuple are in descending
order or not.
INPUT
OUTPUT
Q.19 A tuple stores marks of a student in 5 subjects. Write a program to
calculate the grade of the student.
INPUT
OUTPUT
Q.20 Write a program to input names of n students and store them in a tuple.
Also, input a name from the user and find if this student is present in the
tuple or not.
INPUT
OUTPUT
Q.21 Write a program to delete the keys of a dictionary one by one in LIFO
order. Make sure that there is no error generated after the last item.
INPUT
OUTPUT
Q.22 Write a program to find highest 2 values in a dictionary.
INPUT
OUTPUT
Q.23 Write a program to create a dictionary from a string.
INPUT
OUTPUT
Q.24 Write a program that displays options for inserting or deleting elements
in a list. If the user chooses a deletion option, display a submenu and ask if
element is to be deleted with value or by using its slice is to be deleted.
INPUT
OUTPUT
Q.25 Write a program to find minimum element of a list along with its index.
INPUT
OUTPUT
Q.26 Write a program search for an element in a given list of numbers.
INPUT
OUTPUT
Q.27 Write a program to count the frequency of a given element in a list of
numbers.
INPUT
OUTPUT
GRADE 12
QUESTIONS
INDEX GRADE XII
S.No TOPIC Page
NO.
1. Write a program to calculate simple interest using the function. Specify detail value of 39
rate=10% and time= 2 years
7. EMPLOYEE 72
7.1 Create table.
8. STUDENT 74
8.1 Display records in alphabetical order
as per name of student
8.2 Display Class, DOB and City whose
marks between 450 and 551
8.3 Display Class and total students who
secured more than 450 marks
8.4 To increase marks of all students by
20 who are in class 12
9. STUDENT_RELATIO 76
N
9.1 To show all information of student in
history department
9.2 To list name of female students who
are in Hindi department
9.3 To list name of all the students with
there date of admission in ascending
order
9.4 To display Name, age and fees for
male students only
9.5 To count number of students with
age < 23
9.6 To insert row in student with
following data: -
9,”Zaheer”,36,”Computer”,1997-03-
12,230,’M’
10. DEPT AND WORKER 78
10.1 To display wno, name, gender in
descending order
10.2 To name of all female workers in
workers table
10.3 To display name and wno of those
workers who are born between
‘1987-01-01’ and ‘1986-01-01’
10.4 To count and display all male
workers who joined after ‘1986-01-
01’
10.5 To count number of workers in more
than one dept, dept wise
10.6 To display number of distinct dept
from dept table
10.7 To display name, department and
city of workers with wno < 1003 and
dcode common in workers and dept
table
11. STUDENT_DATA 81
11.1 Display information of students in 11
B
11.2 Display 11th and 12th class student
information
11.3 Display student information who are
not in class 10
11.4 Display total fees paid
12. EMPLOYEE_2 83
12.1 Add primary key constraint to ID
column
12.2 Add foreign key constraint that will
ensure record with invalid
department are prohibited
12.3 Add not null constraint to empname
13. CUSTOMER 84
13.1 Add one column Email: Varchar (30)
OUTPUT
Q.2 Write a function to check weather a number is perfect or not.
INPUT
OUTPUT
Q.3 Write a function to reverse a string.
INPUT
OUTPUT
Q.4 Write a function to find square root of a number.
INPUT
OUTPUT
Q.5 Write a function to return sum of multiple numbers.
INPUT
OUTPUT
Q.6 Write a function to return sum of 3 numbers.
INPUT
OUTPUT
Q.7 Write a random number generator that generates random number
between 1 and 6. (Simulate a dice)
INPUT
OUTPUT
Q.8 Write a function that takes a positive integer and returns the one’s
position digit of integer.
INPUT
OUTPUT
Q.9 Write a recursive code to find the factorial of a number.
INPUT
OUTPUT
Q.10 Write a function to perform binary search in sorted list.
INPUT
OUTPUT
Q.11 Write a program using a recursive function to print Fibonacci series till n
terms.
INPUT
OUTPUT
Q.12 Write a program to perform insert and delete operation on a queue
containing member details as member number, member name and member
age.
INPUT
OUTPUT
Q.13 Write a program to implement stack of book details, each of details
contain book name and book number. Implement PUSH, POP and DISPLAY
operation.
INPUT
OUTPUT
Q.14 Write a program to sort list using bubble sort.
INPUT
OUTPUT
Q.15 Write a program to sort using insertion sort.
INPUT
OUTPUT
Q.16 Write a program to read a text file line by line and display each word
separated by #.
INPUT
OUTPUT
Q.17 Write a program to read text file and display the count of vowels and
consonants in the file.
INPUT
OUTPUT
Q.18 Write a program to get roll numbers, names and marks of students of a
class and store these details in a file called marks.txt.
INPUT
OUTPUT
Q.19 Consider the binary file Student.dat containing student detail. Write a
program to update the records of a file so that those who scored more than
81 get additional bonus marks of 2.
INPUT
OUTPUT
Q.20 Write to program to open a binary file and search for records with roll
number 12 or 14.
INPUT
OUTPUT
Q.21 Write a program to get item details (code, description and price) for
multiple items from the user and create a csv file by writing all the item
details in one go.
INPUT
OUTPUT
Q.22 Write a program to display the number of lines in a file.
INPUT
OUTPUT
TABLES
QUESTION
PRACTICAL 1
TABLE- STUDENT
1.2 Write a query that produces result as student name, aggregate and age.
PRACTICAL 2
TABLE- STUDENT MARKS
Q.2 Write a query to display name, age and marks of students whose age is
greater than or equal to 16.
PRACTICAL 3
TABLE
3.1 Write a query that display all the details from the pet table from species
cat or dog and gender as male.
PRACTICAL 4
4.1 Display all records from table EMPL.
4.5 Write a query to display Employee Number, Name , sal and sal*12as
Annual Salary whose commission is not NULL from table EMPL.
4.9 List the details of all those employees who have four lettered name.
4.10 List the detail of all employees whose annual salary is between 25000-
40000.
4.13 Write a query to display the name, job and salary of employees who do
not have manager.
4.14 Write a query to display the name of employee whose name contain ‘A’
as third alphabet.
4.15 Write a query to display the name of employee whose name contains ‘T’
as last alphabet.
4.16 Write a query to display the name of the employee who is having ‘L’ as
any alphabet of the name.
PRACTICAL 5
TABLE- SPORTS
5.1 Display name of the students who have grade ‘C’ in either Game1 or
Game2 or both.
5.2 Display the name of student who have same game for both Game1 and
Game2.
5.3 Display the game taken up by students whose name starts with ‘A’.
PRACTICAL 6
TABLE- STUDENT
6.1 Display Minimum Marks from Student where AVGMARK<75.
7.2 For record with ID=4 update record with Last_Name,User_ID and Salary.
7.5 Modify salary and increase it by 1000, for all who get salary less than
5000.
7.6 Delete employee having first name ‘Siddharth’.
8.1 Display the records in alphabetical order as per the name of the student.
8.2 Display class ,DOB and city whose marks is between 450 and 551.
8.3 Display name, class and total number of students who have secured more
than 450 marks class wise.
9.2 List the name of female students who are in Hindi department.
9.3 List name of all students with their date of admission in ascending order.
9.4 Display student’s Name, fee age for male students only.
TABLE- WORKER
10.1 Display Wno, Name, Gender from the table WORKER in descending
order of Wno.
10.2 Display the name of all the female workers from the table WORKER.
10.3 Display the WNO and Name of those workers from the WORKER table
who are born between ‘1987-01-01’ and ‘1991-12-01’.
10.4 Count and display MALE workers who have joined after ‘1986-01-01’.
10.5 Count number of workers in more than one dept, dept wise.
10.6 Display number of distinct dept from dept table.
10.7 Display name, department and city of workers with WNO<1003 and
dcode common in workers and dept table.
12.2 Add foreign key constraint that ensures record with invalid departments
are prohibited.
OUTPUT
Q.26 Write a program that displays all records fetched from “Student” table
of MySQL database practical.
INPUT
OUTPUT
Q.27 Write a program to delete the record of student on the basis of name
entered at run time from “Student” table.
INPUT
OUTPUT
Q.28 Write a program to inset multiple records in “Student” table.
INPUT
OUTPUT
OUTPUT