MySQL basic operation (i)

Source: Internet
Author: User

Library operation: show databases;//Show All DatabasesDrop database dbName;//Deleting a databaseCreate DATABASE [ifNot EXISTS] dbName;//Create a databaseUse DbName;//Working with DatabasesShow tables;//displays the name of the table that is currently using the databaseDesc TableName;//show the specific table structuretable operation: Drop table tableName;//Delete a table-create Table TableName (uIdint, Upricedecimal);//Create a data table with UID and Uprice fields-create Table Newtablename (uIdint) as SelectUid fromUser//Copy the UID column from the data table user into the new data table and create the new table-create Table Newtablename as Select* fromuser; single column: ALTER TABLE TABLENAME ADD Tel varchar ( One)default '14545';//add a field inside a table-Multiple columns: ALTER TABLE tableName Add (photo blob,birthday data);//Add multiple ColumnsALTER TABLE Oldusername Rename to Newusername;//Rename table nameALTER TABLE tableName change oldname newName varchar (Ten);//Field RenameALTER TABLE TABLENAME Modify TEL varchar ( the)default‘48777777889979' first; Modify the Tel field and let him show the ALTER TABLE TableName drop tel in column one;//Delete Tel field

MySQL basic operation (i)

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.