Practical File
Practical File
29-05-2023
ASSIGNMENT 1:
(Don’t Write in the nb, it’s for your reference) Draw the table given on pg 574, Q17 on the blank
space on page 1.
USE school;
);
c. Show the description of the table.
DESC Teacher;
(1,"Jugal",34,"Computer","1997-01-10",12000,"M"),
(2,"Sharmila",31,"History","1998-03-24",20000,"F"),
(3,"Sandeep",32,"Maths",”1996-12-12”,30000,"M"),
(4,"Sangeeta",35,"History",”1999-01-07”,40000,”F”),
(5,"Rakesh",42,"Maths",”1997-05-09”,25000,"M"),
(6,"Shyam",50,"History",”1998-06-27”,30000,"M"),
(8,"Shalakha",33,"Maths",”1997-07-31”,20000,"F");
SCREENSHOT OF INSERT QUERY(OPTIONAL)
E .Show all information about the teachers from history department:
F. List all the names of female teachers who are in Hindi Department:
SELECT Name FROM Teacher WHERE Department = "Hindi" and Sex = "F";
G. To list names of all teachers with their date of joining in ascending order:
SELECT Name, Age, Salary FROM Teacher WHERE Salary BETWEEN 11000 AND 26000;
I. Display name of those teachers whose name starts with s and belong to history department.
SELECT Name FROM Teacher WHERE Department = "History" AND Name like "S%";
5/06/2023
ASSIGNMENT 2-
A. Create Students table in any existing database.
B. Insert values into the table.
C. Insert a new field remark, if the total is above 450 write Excellent, if it’s between 400 and less than
450 Very Good, Between 350 and less than 400 Good, otherwise Work Hard.
D. Display the games taken up by students, whose name starts with “R” or ends with ‘I’.
E. Update the name Dhriti as Dhriti R where remark is Very Good.
F. Count total no. of records
G. Update chem as 97 for 1004.
H. Print the records in ascending order using name and descending order using CS
I. Print the name of that child who has got minimum marks in CS.
J. Print the max marks in Maths and name of the child. Find out the average and percentage of the
child.
Assignment 4:
Together With - Page no 160 Q no 24
Assignment 5:
Together with Q 21- pg no 158.
Assignment 6
WAP to connect Python with MySQL and create a medicine table in Hospital database.
Medicine table contains the details as medicine id, manufacturer name, manufacturing date,
expiry date, quantity, salary.
Enter the data from the user using old parameterised style.
Assignment 7
WAP to connect with Hospital database and search in Doctors table for doctor’s details who are
specialised in treating cancer patients. (new style)
Assignment 8
WAP to connect with Hospital database and delete all the expired medicines from medicine
table. Print the updated table. (new style)
Assignment 9
WAP to connect with Hospital database and increase the salary by 5000 for those doctors who
have completed 10 years. Print the updated table. (old style)
Assignment 10
Write a function create () to enter the details of 5 employees in a csv file, emp.csv . Details like empid, ename, salary
and address. Write a function find() to find the details of employees where name is given by the user.
Assignment 11
Create a binary file with roll number, name, percentage and cash_prize . Keep the prize money as 0 initially and
search for those students who have got 90% and above. Award cash_prize as 1000/-. Print the complete details of
the students got prize amount.
Assignment 12
Read a text file and display the number of vowels/consonants/uppercase/lowercase characters in the file.
Assignment 13
Read a text file data.txt and count the number of times ‘as’ occurs in the file. Replace ‘as’ with ‘because’ ; print the
updated file with the count of the updated sentences.
Output: I am not going to the school because I am not well. I will go tomorrow.
1 sentence is updated.
Assignment 14:
Write a function to read the content from ‘qoutes.txt’ and transfer the content to the file
‘duplicate.txt’. While transferring convert all the uppercase characters to lowercase character and
vice-versa.
Assignment 15:
Write a function to read the content from the file ‘collection.bat’ and store the frequency of each
word in dictionary and display the dictionary on the screen.
Assignment 16:
Write a method in Python to read lines from a text file mynotes.txt and display those lines which
are starting with the alphabet A or T.