10-11 Database Exercises

Source: Internet
Author: User

1. Query the sname, Ssex, and Sclass columns of all records in the student table.

Select Sname,ssex,sclass from Studeng

2, the inquiry teacher all units namely does not duplicate depart column.

3. Query all records of student table.

SELECT * FROM Studeng

4. Query all records from 60 to 80 of the scores in the score table.

SELECT * from score where degree >= and degree <= 80

5. Check the record of 85, 86 or 88 in the score table.

SELECT * FROM score where degree = degree = or degree = 88

6, inquires the student table "95031" class or the sex is "the female" the classmate record.

SELECT * from Studeng where sclass = 95031 or ssex = ' female '

7. Query the student table for all records in descending order of class.

SELECT * FROM Studeng t ORDER by sclass DESC

8, in CNO Ascending, Degree descending query score all records of the table.

SELECT * FROM score T ORDER by Cno, degree desc

9. Check the number of students in "95031" class.

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

SELECT * FROM score T ORDER by degree DESC

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.

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

Select Sno from score t where degree >=70 and degree <=90

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

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

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

10-11 Database Exercises

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.