ComputerScience SQP
ComputerScience SQP
1. Consider the following table STUDENT. Write SQL Commands for the following
statements. 5
TABLE : Student
Student Class Name Game Grade1 SUPW Grade2
No
10 7 Sameer Cricket B Photography A
11 8 Sujit Tennis A Gardening C
12 7 Kamal Swimming B Photography B
13 7 Veena Tennis C Cooking A
14 9 Archana Basket A Literature A
ball
15 10 Arpit Cricket A Gardening C
i) Display the names of the students who are getting a grade ‘C’ in either
GAME or SUPW.
ii) Display the number of students getting grade ‘A’ in cricket.
iii) Display the different games offered in the school.
iv) Display the SUPW taken up by the students, whose name starts with ‘A’.
v) Arrange the whole table in the alphabetical order to SUPW.
2.Write a function in Python that counts the number of “Me” and “My” words
present in a text file “Story.txt” contents are as follows: 4
My first book
was Me and
My family. It
gave me
chance to be
known to the
world.
The output of the function should be:
Count of Me/My in file.
1
3. The code given below inserts the following record in the table 3
Student:
RollNo – integer
Name – string
Clas – integer
Marks – integer
2
password="tiger", database="school")
mycursor= #Statement 1
rno=int(input("Enter Roll Number :: "))
name=input("Enter name :: ")
clas=int(input("Enter class :: "))
marks=int(input("Enter Marks :: "))
querry="insert into student
values({},'{}',{},{})".format(rno,name,clas,marks)
#Statement 2
# Statement 3
print("Data Added successfully")
7
4
Practical Copy
5 8
Project
6
Viva 3
3
4
5