Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Q1.

What is the cartesian product of the following two tables:


S table P table

Q2. What will be the result of the following: select distinct city from s
Q3. What will be the result of the following: select distinct sno from s;
Q4.
course table

department table

select * from course, department

Q5. What will be the result of the following:


select * from course, department where COURSE.DEPT_NAME = department.DEPT_NAME;

Q6. What will be the result of the following: select * from s where sname like '%e%';

Q7. What will be the result of the following: select * from s order by city;
Q8. What will be the result of the following: select * from s order by city desc;
Q9. What will be the result of the following: select * from p where weight between 12 and 14;
Q10.
sale2011 table sale2012 table

What will be the result of the following: select product_name from sale2011
What will be the result of the following: select product_name from sale2012
What will be the result of the following:
select product_name from sale2011
union
select product_name from sale2012;

What will be the result of the following:


select product_name from sale2011
intersect
select product_name from sale2012;

select product_name from sale2011


minus
select product_name from sale2012;
*except is standard term; for oracle use minus

Q11. What will be the result of the following: select avg(unit_price) from sale2012;
Q12. What will be the result of the following: select min(unit_price) from sale2012;
Q13. What will be the result of the following: select max(unit_price) from sale2012;
Q14. What will be the result of the following: select sum(unit_price) from sale2012;
Q15. What will be the result of the following: select count(*) from s;

Q16. What will be the result of the following:


select count(*), city from s
group by city;

Q17. What will be the result of the following:


select max(weight), city from p
group by city;

Q18. What are the valid clauses? Pick multiple


where, select, group by, sort by, order by, find

Q19. Which is used for what:


union, avg, max, sum, intersect

Q20. What will be the result of the following: select * from s where city in ('London', 'Athens');
Q21. What will be the result of the following: select * from s where city not in ('London');
Q22. What will be the result of the following:
select count(*) from
(
select * from s where city not in ('London')
);

Q23. What will be the result of the following:


select sum(weight) from
(
select * from p where city not in ('London')
);

You might also like