0% found this document useful (0 votes)
11 views

IP practice Assignment

Uploaded by

class 9b
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

IP practice Assignment

Uploaded by

class 9b
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

INFORMATICS PRACTICES (065)

Practice Assignment

Q1. Consider the following Table and write the queries of (i) to (X) 10 X1=10
Consider the following table STUDENT
Table: Student

NO. NAME STIPEND STREAM AVGMARK GRADE CLASS


1 KARAN 400.00 MEDICAL 78.5 B 12B
2 DIVAKAR 450.00 COMMERCE 89.2 A 11C
3 DIVYA COMMERCE 68.6 C 12C
4 ARUN 350.00 HUMANITIES 73.1 B 12C
5 SABINA 500.00 NONMEDICAL 90.6 A 11A
6 JOHN 400.00 MEDICAL 75.4 B 12B
7 ROBERT 250.00 HUMANITIES 64.4 C 11A
8 RUBINA NONMEDICAL 88.5 A 12A
Degree of student table=7
Cardinality of student table=8
i. Display records of MEDICAL stream students.
Select * from student where stream=”MEDICAL”;
ii. Display the records of student who have obtained A and B grade
Select * from student where grade=’A’ or grade=’B’
Display the records of student who have obtained avgmark more
than 50 but less than equal to 80
Select * from student where avgmark>50 and avgmark<=80;
iii. Display the records of students in ascending order of their AVGMARK.
Select * from student order by AVGMARK asc;
iv. display names, stipend and class of 12 class students.
Select name, stipend, class from student where class like ‘12%’;
v. delete the records of COMMERCE students.
delete from student where stream=”commerce”;
vi. Delete the records of students of class 12
delete from student where class like ‘12%’;
vii. Delete all the records
delete from student;
viii. Show the names of students whose name start with D.
Select name from student where name like ‘D%’;
ix. Increase the stipend of all students of medical stream by 100
Update student set stipend=stipend+100 where stream=’MEDICAL’;
x. Increase the stipend of all students by 100
Update student set stipend=stipend+100;
xi. decrease the stipend of all students by 100
Update student set stipend=stipend-100;
xii. increase the stipend of all students by 2%
Update student set stipend=stipend+stipend*2/100;

xiii. Display the records of student whose stipend value is available.


Select * from student where stipend is not NULL;
xiv. Display the records of student who is not getting stipend.
Select * from student where stipend is NULL;

xv. Add a new record in the table as


9 KANIKA 600 MEDICAL 89.9 A 12 B
Insert into student values(9, ‘KANIKA’, 600, ‘ MEDICAL’ 89.9, ‘ A’,
‘12 B’)
xvi. Remove the existence of table from the database.
drop table student;

Q2. Give the output of the following on the basis of student Table 5 x 1=5

i. Select sum(stipend) from student;


2350.00
ii. Select max(AVGMARK) from student;
90.6
iii. Select count(stipend) from student;
6
iv. Select count(*) from student;
8
v. Select name from student where grade=’A’;
3

Q3. Answer the following questions on the basis of student Table: 5 x 1=5

1. Which column of the table should be considered as primary key and


why?
2. Mention the candidate and alternate keys of the table.
3. What is the degree of the table student?
4. What is the cardinality of table student?
5. Which command can be used to add a new column in the table student.

You might also like