Differences and use of Update,alter,modify,delete,drop in SQL (collation)

Source: Internet
Author: User

About UPDATE and ALTER:

Baidu knows about the update and alter has a very image of the summary: A table has a lot of fields, a field has a lot of data. A family has a lot of rooms, a room with a lot of furniture. Update is used to change the wardrobe to a bookshelf. Alter is used to change the kitchen into a toilet.

Change the bedroom to a toilet: ALTER TABLE your home changes kitchen toilet varchar (8);

Add a toilet to your home: ALTER TABLE your home add toilet varchar (8); (8 means 8 square meters of toilet)

Modify toilet size: ALTER TABLE your home modify (toilet varchar (100));

Name the toilet: ALTER TABLE Your home rename column toilet to toilet;

Destroy toilet: ALTER TABLE your home drop column toilet;

and change the wardrobe to a bookshelf: Update your home set wardrobe = bookshelf where ...; (without where, all the closets in the room became bookshelves). Update your home set wardrobe =null where ...; Delete the wardrobe.

Delete and drop:delete remove the wardrobe or delete the Bookshelf; Drop is the delete room; Delete a wardrobe: delete from your home where id= wardrobe; Even if the data is deleted, the table structure is still there. Delete a toilet: ALTER TABLE your home drop column toilet;

Delete a database: Drop your home;

Http://www.cnblogs.com/lamian/p/3972562.html

The difference and use (collation) of Update,alter,modify,delete,drop in SQL (GO)

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.