Database quiz question 2 and database quiz question 2

Source: Internet
Author: User

Database quiz question 2 and database quiz question 2

Questions on Century jiayuan Network

1. count the number of persons in each category (type:

Select type, count (type) from tab_user group by type;

2. Count the total score of five people:

Select sum (score) from tab_user;

3. Select the top three according to the score, and sort them in reverse order:

Select * from 'tab _ user' order by score desc limit 3;

4. insert data: James (name), 4 (type), 30 (score );

Insert into 'tab _ user' (name, type, score) values ('xiaoming ', '4', '30 ');

5. The score for updating 50 points (excluding 50 points) is 60;

Update 'tab _ user' set score = 60 where score <50;

6. Delete the data with a score of 60.

DELETE from 'tab _ user' where score <60;

 

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.