0% found this document useful (0 votes)
24 views2 pages

Sample Practical QP 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Sample Practical QP 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

SET - 1

______________________________________________________________________
1. Write a Java program to prepare class percentage report using array. 10

2. SQL Queries 10
TABLE: SPORTS
Student No Clas Name Game1 Grade1 Game2 Grade2
s
10 7 Sameer Cricket B Swimming A
11 8 Sujit Tennis A Skating C
12 7 Kamal Cricket B Football B
13 7 Veena Tennis C Athletics A
14 9 Archana Basketball A Athletics A
15 10 Arpit Cricket A Athletics C

(a) Write a query to create Sports table.


Ans: Create table sports (StudentNo int(5), class int(2), Name varchar(20),
Game1 varchar(20), Grade1 Char(2), Game2 varchar(20), Grade2 char(2));
(b) Display the names of the students who have grade ‘C’ in either Game 1
or Game 2 or both
Ans: Select name from sports where grade1=’C’ and grade2=’C’;
(c) Display the number of students getting grade ‘A’ in Cricket.
Ans: Select count (*) from sports where game1= “cricket” and Grade1 = “A”;
(d) Display the names of the students who have the same grade for both
Game 1 and Game 2.
Ans: Select name from sports where grade1= = grade2;
(e) Display the games taken up by the students, whose name starts with ‘A’.
Ans: select game1, game2 from sports where name like “A%”;
(f) Add a new column named ‘Markes’.
Ans: Alter table sports add marks int(3);

You might also like