0% found this document useful (0 votes)
46 views5 pages

practical file questons2024-25

Uploaded by

divyp4183
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)
46 views5 pages

practical file questons2024-25

Uploaded by

divyp4183
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/ 5

Mount Litera Zee School, Mathura

Session 2024 – 25
Class XII - Practical File Questions
Python programs
1: Program to enter two numbers and print the arithmetic operations like +,-,*, /, // and %.
2: Write a program to find whether an inputted number is perfect or not.
3: Write a Program to check if the entered number is Armstrong or not.
4: Write a Program to find factorial of the entered number.
5: Write a Program to enter the number of terms and to print the Fibonacci Series.
6: Write a Program to enter the string and to check if it‟s palindrome or not using loop.
7: Recursively find the factorial of a natural number.
8: Read a file line by line and print it.
9: Remove all the lines that contain the character “a” in a file and write it into another file.
10: Read a text file and display the number of vowels/consonants/uppercase/lowercase
characters in the file.
11: Create a binary file with name and roll no. Search for a given roll number and display the
name, if not found display appropriate message.
12: Write a random number generator that generates random numbers between 1 and
6(simulates a dice)
13: Write a python program to implement a stack using a list data structure.
14: Read a text file line by line and display each word separated by a #
15: Create a CSV file by entering user-id and password, read and search the password for
given user id.
16: Write a Program to search an element using linear search.
17: Write a program to sort a sequence using insertion sort.

Programs on data structure stack


18: Write a menu-driven python program to implement stack operation.
19: Write a program to implement a stack for the employee details (empno, name).
20: Write a python program to check whether a string is a palindrome or not using stack.

SQL queries using one/two tables


1: Create a student table and insert data. Implement the following SQL commands on the
student table:
● ALTER table to add new attributes / modify data type / drop attribute
● UPDATE table to modify data
● ORDER By to display data in ascending / descending order
● DELETE to remove tuple(s)
● GROUP BY and find the min, max, sum, count and average
2: Consider the following MOVIE table and write the SQL queries based on it.

Movie_I
MovieName Type ReleaseDate ProductionCost BusinessCost
D

M001 The Kashmir Files Action 2022/01/26 1245000 1300000

M002 Attack Action 2022/01/28 1120000 1250000

M003 Looop Lapeta Thriller 2022/02/01 250000 300000

M004 Badhai Do Drama 2022/02/04 720000 68000

M005 Shabaash Mithu Biography 2022/02/04 1000000 800000

M006 Gehraiyaan Romance 2022/02/11 150000 120000

1. Display all information from movie.


2. Display the type of movies.
3. Display movieid, moviename, total_eraning by showing the business done by the movies.
Claculate the business done by movie using the sum of productioncost and businesscost.
4. Display movieid, moviename and productioncost for all movies with productioncost
greater thatn 150000 and less than 1000000.
5. Display the movie of type action and romance.
6. Display the list of movies which are going to release in February, 2022.

3: (Based on Functions)

1. Write a query to display cube of 5.


2. Write a query to display the number 563.854741 rounding off to the next hnudred.
3. Write a query to display “put” from the word “Computer”.
4. Write a query to display today‟s date into DD.MM.YYYY format.
5. Write a query to display „DIA‟ from the word “MEDIA”.
6. Write a query to display moviename – type from the table movie.
7. Write a query to display first four digits of productioncost.
8. Write a query to display last four digits of businesscost.
9. Write a query to display weekday of release dates.
10.Write a query to display dayname on which movies are going to be released.
4: (DDL Commands)

Suppose your school management has decided to conduct cricket matches between students of
Class XI and Class XII. Students of each class are asked to join any one of the four teams –
Team Titan, Team Rockers, Team Magnet and Team Hurricane. During summer vacations,
various matches will be conducted between these teams. Help your sports teacher to do the
following:

1. Create a database “Sports”.


2. Create a table “TEAM” with following considerations:
o It should have a column TeamID for storing an integer value between 1 to 9, which
refers to unique identification of a team.
o Each TeamID should have its associated name (TeamName), which should be a
string of length not less than 10 characters.
o Using table level constraint, make TeamID as the primary key.
o Show the structure of the table TEAM using a SQL statement.
o As per the preferences of the students four teams were formed as given below.
Insert these four rows in TEAM table:
▪ Row 1: (1, Tehlka)
▪ Row 2: (2, Toofan)
▪ Row 3: (3, Aandhi)
▪ Row 3: (4, Shailab)
o Show the contents of the table TEAM using a DML statement.
3. Now create another table MATCH_DETAILS and insert data as shown below. Choose
appropriate data types and constraints for each attribute.

FirstTeam SecondTeam
MatchID MatchDate FirstTeamID SecondTeamID
Score Score

M1 2021/12/20 1 2 107 93

M2 2021/12/21 3 4 156 158

M3 2021/12/22 1 3 86 81

M4 2021/12/23 2 4 65 67
M5 2021/12/24 1 4 52 88

M6 2021/12/25 2 3 97 68

5: (Based on Two Tables)

1. Display the matchid, teamid, teamscore whoscored more than 70 in first ining along with
team name.
2. Display matchid, teamname and secondteamscore between 100 to 160.
3. Display matchid, teamnames along with matchdates.
4. Display unique team names
5. Display matchid and matchdate played by Anadhi and Shailab.

6: (Group by , Order By)

Consider the following table stock table to answer the queries:

itemno item dcode qty unitprice stockdate

S005 Ballpen 102 100 10 2018/04/22

S003 Gel Pen 101 150 15 2018/03/18

S002 Pencil 102 125 5 2018/02/25

S006 Eraser 101 200 3 2018/01/12

S001 Sharpner 103 210 5 2018/06/11

S004 Compass 102 60 35 2018/05/10


S009 A4 Papers 102 160 5 2018/07/17

1. Display all the items in the ascending order of stockdate.


2. Display maximum price of items for each dealer individually as per dcode from stock.
3. Display all the items in descending orders of itemnames.
4. Display average price of items for each dealer individually as per doce from stock which
avergae price is more than 5.
5. Diisplay the sum of quantity for each dcode.

SQL Database Connectivity Programs


1. Write a MySQL connectivity program in Python to
o Create a database school
o Create a table students with the specifications – ROLLNO integer, STNAME
character(10) in MySQL and perform the following operations:
▪ Insert two records in it
▪ Display the contents of the table
2. Perform all the operations with reference to table „students‟ through MySQL-Python
connectivity.
3. Program 16: Integrate SQL with Python by importing the MySQL module.
4. Program 17: Integrate SQL with Python by importing the pymysql module.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy