Manipulate data with SQL statements-———— it elite outfit Tour

Source: Internet
Author: User

Today, I share with you is the code to manipulate the database, that is, other people admire us for a major reason, the following are some points oh, pass by, do not miss.

1. in SQL Sever ,SQL statements are case insensitive ( database name , table name , column name , keyword ).

2. when working with the table, make sure to switch to the corresponding database using the USE keyword first (everyone must pay attention!!!). )

3. The self-increment column cannot be assigned a value.

4. A solution for inserting multiple data into a single table at once:

1/insert into target table select * from original table (note: If there are self-increment columns in the target, you cannot use the * number.) )

2/Copy the original table:SELECT * Into the target table (not present) from the original table (this method only retains the data and child increment columns, but the primary key and other constraints are not.) )

6. See the update statement and delete, be sure to follow the where condition.

7.What is the difference between delete and truncate ?

The Delete can be followed by a where condition, and truncate not .

The log is logged when delete deletes data, and truncate does not

Delete deletes all databases in the table,theID number will not start at 1, and truncate will.

8.truncate is also known as " truncated table ".

The 9.truncate runs more efficiently because it does not log logs. But delete can log logs and can be restored.

look at the above words, whether you have the harvest, some words on my attention!!! I'll try harder next time.

Manipulate data with SQL statements-———— it elite outfit Tour

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.