MySQL exercises "one" additional question

Source: Internet
Author: User

    1. Create message database: LIUYANDB;
    2. Create a message form Liuyan in the LIUYANDB database, with the following structure:

Table name

Liuyan

Message Information Form

Serial number

Field name

Field description

Type

Property

Note

1

Id

Number

Int (4)

Non-empty

Primary key, self-increment 1

2

Title

Title

varchar (32)

Non-empty

3

Author

Author

varchar (16)

Can be empty

4

Addtime

Message time

Datatime

Non-empty

5

Content

Message content

Text

Non-empty

6

Isdelete

Whether to delete

char (1)

Non-empty

Default value 0

    1. Add a column status at the end of the message list (status char (1) default value is 0)
    2. Modify the message table author default value is ' Youku ', set to non-empty
    3. Remove the Isdelete field from the Liuyan table
    4. Add >5 test data to the message table

    1. Required to change the value of author field to admin in information with ID value greater than 3
    2. Delete the data with ID number 4.

Additional questions:

    1. Add >15 test data to the message table, require three users to add
    2. Check all message information
    3. Query a user's message information.
    4. Queries all data, sorted by time in descending order.
    5. Get message with ID from 2 to 6 and sort by time descending
    6. Count the number of messages left by each user and sort them from small to large.
    7. Change the author of two data with ID 8 and 9 to ' Doudou '.
    8. Take out the latest three messages. (use limit).
    9. Query message contains "D" letter message, and according to the message time from small to large sort
    10. Delete "Author" duplicate data and retain one author with the largest ID

MySQL Exercises "One" additional question

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.