Final Vidhya LN Class 12 Practicals
Final Vidhya LN Class 12 Practicals
Final Vidhya LN Class 12 Practicals
SCHOOL
BANGALORE SOUTH
PROGRAMMING
IN
PYTHON & SQL
DONE BY:
VIDHYA LAKSHMINARAYANAN
XII ‘B’
2024-2025
CERTIFICATE
This is certified to be the bonafide work of the student in the computer science
laboratory during the academic year 2024-2025.
__________________________
TEACHER INCHARGE
_______________________
____________
EXAMINER’S SIGNATURE
PRINCIPAL
Date: ______________
S.NO PROGRAM
.
➢ Display the content line by line with each word separated by “$”.
➢ Remove the line which has ‘a’ and copy that line to another file.
➢ Display the content line by line with each word separated by “$”.
➢ Remove the line which has ‘a’ and copy that line to another file.
QUESTION 7 Menu driven program (Text file):
➢ Create another file which will contain the text after replacing all the blank
spaces with '#'.
➢ To read lines from text file and display those words which are less than 4
characters.
➢ Read contents of the file and display the details of those students whose
percentage is
above 75. Also display the number of students scoring above 75%.
QUESTION 10 Menu driven program (Binary file):
➢ read the file and calculate the total and percentage for each student.
➢ display the name of student if in any subject marks are greater than 80%.
QUESTION 13 Menu driven program (CSV file):
➢ to search the record and display the record, otherwise display appropriate
messages.
QUESTION 14 Menu driven program:
➢ To perform Push, Pop operations on the stack named ‘Hostel’ with the given
constraints.
QUESTION 15 Menu driven program:
➢ To perform Push, Pop operations on the stack named ‘Book’ with the given
constraints.
SQL
16.Consider the following two tables: PRODUCT and CLIENT.
Table: Product
Table: Client
f. Select C_ID, Client_Name, City from Client where City Like ‘M%’;
17.Write SQL commands based on table SPORTS:
Table: SPORTS
a. Display the names of the students who have grade ‘C’ in either Game1 or
Game2 or both.
b. Display the number of students getting grade ‘A’ in Cricket.
c. Display the names of the students who have the same game for both
Game1 and Game2.
d. Display the game taken up by the students, whose name starts with ‘A’.
e. Add a new column named ‘Marks’.
f. Assign a value 200 for marks for all those who are getting grade ‘B’ or
grade ‘A’ in both Game1 and Game2.
Solution:
Table: Consumer
19.Create a table with constraints and Write SQL commands for the
following:
MOVIE
Movie_Id Movie_Name Type Cast Rating Qty Price
M001 Gone With the Drama Clark A 10 39
Wind Gable
M002 Doctor DoLittle Comedy Eddie B 3 40
Murphy
M003 Coyote Ugly Drama Piper C 4 35
Perabo
M004 Rush Hour Comedy Jackie A 5 1
Chan
M005 Bourne Identity Action Matt B 7 22
Damon
M006 Casino Royale Action Daniel B 3 90
Craig
M007 Runaway Bride Comedy Julia C 1 19
Roberts
a. Find the movies starring Julia Roberts.
b. To display the different types of movies available.
c. Display all movies which have a price range between 30 and 40.
d. Display all movies where the Rating is A
e. Display count of movies by type.
f. Display movie names which are starting from ‘R’.
ANSWERS
a. Select*from movie where cast = ‘Julia Roberts’;
Table: Job
Solution:
a. Select employeeid, name,job.jobid, jobtitle from employee, job
where employee.jobid = job.jobid;