Common field types: bit (0 and 1), datetime, int, varchar, and nvarchar (which may contain nvarchar in Chinese)
Differences between Varchar, nvarchar, and char (n): Fill in spaces when char (n) is less than n.
In SQL statements, strings are enclosed in single quotes.
SQL statements are case insensitive. Not sensitive is the SQL keyword, and the string value is still sensitive.
Simple INSERT statement insert into Person (Id, Name, Age) VALUES (1, 'Jim ', 20)
Common int and uniqueidentifier as primary key data types
Identity specification: automatically fill in the value of the primary key. Set the field "Yes ID column" to "yes". A table can only have one ID column.
The Guid algorithm is an efficient algorithm that generates unique identifiers .. Method for generating Guid in. Net: Guid. NewGuid () returns the Guid type. The Guid generated in SQL server is newid ()
The data inserted with Guid is inconsistent with the displayed data.
Data Update
Update a column: Update person set Age = 30
Update multiple columns: updage person set Age = 30, Name = 'Tom'
Update part of data: update person set age = 30, where Name = 'Tom'
Note that the SQL statement uses single = instead of =
Delete all data in a table: delete from person (the drop statement deletes the table)