Oracle Database Jobs-5 queries

Source: Internet
Author: User
Tags joins

14. Sname, CNO and degree columns for all students are queried.

Select T.sname,c.cno,c.degree from student t Inner joins score C on T.sno=c.sno

15. Check the SNO, CNAME and degree columns of all students.

Select T.sno,s.degree,c.cname from student T, score S,course C where T.sno=s.sno and S.cno=c.cno

16. Check the sname, CNAME and degree columns of all students.

Select T.sname,s.degree,c.cname from student T, score S,course C where T.sno=s.sno and S.cno=c.cno

17. Check the average score of "95033" class students.

Select round (AVG (degree), 2) from score s where Sno in (select Sno from student where Sclass = ' 95033 ')

18. Assume that a grade table is created using the following command:

CREATE table Grade (Low number (3), UPP number (3), rank char (1))

Insert into grade values (90,100, ' A ')

Insert into grade values (80,89, ' B ')

Insert into grade values (70,79, ' C ')

Insert into grade values (60,69, ' D ')

Insert into grade values (0,59, ' E ')

The SNO, CNO and rank columns of all students are now queried.

Select S.sno,s.cno,g.rank from score s joins grade G on s.degree between G.low and G.upp

19, the query elective "3-105" course performance is higher than the "109" student scores of all the students record.

SELECT * FROM Score T WHERE degree> (select degree from score where sno= ' 109 ' and cno= ' 3-105 ') and CNO = ' 3-105 '

21. The result of the inquiry is higher than the record of "109" and the grade of the course number "3-105".

SELECT * FROM Score T WHERE degree> (select degree from score WHERE sno= ' 109 ' and cno= ' 3-105 ')

22. The SNO, sname and Sbirthday of all students who were born in the same year were queried and studied for 108.

Select S.sno,s.sname,s.sbirthday from student s where S.sbirthday in (select S.sbirthday from student s where s.sno= ' 108 ' )

Oracle Database Jobs-5 queries

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.