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