0% found this document useful (0 votes)
6 views1 page

Sub Query

Uploaded by

kvuit
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)
6 views1 page

Sub Query

Uploaded by

kvuit
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/ 1

select * from student;

select * from faculty;

select * from department;

select * from student where dno = (select dno from faculty where faculty_id= 'IT001');

select * from student where dno = (select dno from faculty where faculty_id= 'EC001' or faculty_id
='IT001');

select * from student where dno in (select dno from faculty where faculty_id= 'EC001' or faculty_id
='IT001');

select * from faculty where salary > any (select salary from faculty where Faculty_name ='Harshitha'
or faculty_name = 'Raja');

select * from faculty where salary > all (select salary from faculty where Faculty_name ='Harshitha'
or faculty_name = 'Raja');

select count(*) from student where marks in (select s.marks from student s ,student d where
s.marks = d.marks and s.regno <> d.regno);

select avg(marks),dno from student group by dno having avg(marks)>80;

You might also like