One, the operation of the table
Tables: creating, modifying, deleting
all existing tables can be viewed through the select * from sysobjects where xtype= ' U '
Use commas to separate multiple columns
PRIMARY key:primary key
non-empty: notnull
Unique :unique
defaults: Default()
checking:check ()
foreign key:foreign KEY ( column name ) references table name ( column name )
For example:--Create a table
Use practicedbcreate table ClassInfo (CIdintNotNULLPrimary Key Identity (1,1), Ctitle nvarchar) CREATE table studentinfo (SIdintNotNULLPrimary Key Identity (1,1), SName nvarchar (Ten) notNULL, Sgender bitdefault(0), Sbirthday date, SphoneChar( One), Semail varchar ( -), CidintNotNULL, foreign KEY (CID) references ClassInfo (CID))
Second, the operation of the table data
-"Simple query: SELECT * FROM table name"
-"Add data: INSERT into table name (column name) values (value)
Illustration 1: The column name of the required value corresponds to the position of the value
Note 2: You can omit the column name section if all the more values are inserted
Extensions: Add multiple lines at once, and you can stitch multiple data directly behind the values, separated by commas
-"Modify data: Update table name set column name 1= value 1, column name 2= value 2 ... where ...
-delete data: Delete from table name where ...
Empty: TRUNCATE TABLE name
Description: The FROM keyword can be omitted without writing
Typically implemented: tombstone, physical Delete
Database Review Summary (7)-creation of tables and insertion of commands, data modification, data deletion