Database SQL statement Exercises 10--18

Source: Internet
Author: User

10. Check the student number and course number of the highest score in the score table. (sub-query or sort)

Select  from where = (selectmax from score T)

11. Check the average score of each course.

12. Check the average score of the course with at least 5 students enrolled in the score table and begin with 3.

Select avg  from where inch (selectfromgroupby haveCount(1)>=  5and like'3%';

13, the query score is greater than 70, less than 90 of the SNO column.

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

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

Select  from Join  on =

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

Select  from where =  and = C.cno

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

Select avg  from Score T  where in (selectfromwhere='  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.

Database SQL statement Exercises 10--18

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.