Data Query Practice 1~11

Source: Internet
Author: User


--1.
SELECT * from T_hq_student;

Select SNAME, SSEX, CLASS from T_hq_student;

--2.
Select distinct depart from T_hq_teacher;

--3.
SELECT * from T_hq_student;

--4.
SELECT * from T_hq_score where degree between and 80;

--5.

SELECT * from T_hq_score where degree in (' 85 ', ' 86 ', ' 88 ');

--6.
SELECT * from t_hq_student where SSEX like ' woman ' and CLASS like ' 95031 ';

Select *from t_hq_student where CLASS = ' 95031 ' and SSEX = ' female ';

--7.
Select CLASS from T_hq_student order by CLASS Desc;

--8.
Select Cno,degree from T_hq_score ORDER by CNO ASC, Degree desc;

--9.
Select Class,count (1) As quantity from T_hq_student Group BY class have class = ' 95031 ';

--10.
SELECT * from T_hq_score where degree >= all (select degree from T_hq_score);

--11.
Select Cno,count (1) as number, AVG (degree) as average from T_hq_score group by CNO;

Data Query Practice 1~11

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.