MySQL creates library-to-table writes, etc.

Source: Internet
Author: User

  1. Create a library

    Create DATABASE xxx;

  2. View Library Name

    show databases;

  3. Enter Library

    Use XXX;

  4. View Table

    Show tables;

  5. Create a table

    Create tables xxx;

  6. Clear table

    Delete from xxx;

  7. View table Structure

    describe xxx;

  8. CREATE table name written with ID XM XB CSNY

    CREATE table name (ID int (3) auto_increment NOT null primary key, XM char (8), XB char (2), CSNY date);

  9. Write Records

    INSERT into XXX values (' ', ' Zhang San ', ' Male ', ' 1971-10-01 ');

    INSERT into XXX values (' ', ' John Doe ', ' female ', ' 2010-3-2 ');

  10. Verify that the write is correct

    select * from XXX;

  11. Modify a record

    Update xxx set csny= ' 2009-2-23 ' where xm= ' Zhang San ';

  12. Delete a table record

    Delete from name where xm= ' Zhang San '

  13. Delete a table

    drop table xxx;

MySQL creates library-to-table writes, etc.

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.