The number of students in the class is greater than 10, the number of students in the class is greater than 50, the number of students in the computer school, and the average number of students in the class is from high to low.

Source: Internet
Author: User
/* Table scores has four fields: Student Stu, class, school institute, and score.
Returned results: the number of students in the class is greater than 10, the number of students in the class is higher than 50, and the average score of the Computer College and the class is from high to low.
You can use any database to write SQL statements. The returned fields are class and the average score is. */

-- Nesting statements are not allowed.
Select top 10 class, average score = AVG (score) from TB
Where Institute = 'computer Emy'
Group by class
Having count (1)> = 10 and min (score)> = 50
Order by AVG (score) DESC

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.