Create DATABASE s2015041--Create a database drop DB XXXXXX--Delete Database use master--using the master database go--link symbol for statement and statement CREATE TABLE ABB (CodeintNotNULL,--column name varchar ( -) notNULL,--column Sexint, Degreedecimal( -,2) notNULL--column) Go insert INTO ABB values (1,'Zhang San',0, About); INSERT into ABB VALUES (2,'John Doe',1, -);--Once the primary key is set, it needs to be saved before it can be recognized, preventing duplicate INSERT into ABB (Code,name,degree) VALUES (4,'Harry', the);--Specify column Add GoSelect* fromABB--Query Update ABBSetsex=1--Modify the value of the sex column in all rows update ABBSetsex=1 whereCode=4--Add Where Condition filter Modify code=3 sex update on that line ABBSetName='Tianqi', sex=0, code=3, degree= About whereCode=4Delete fromabb--Delete all data Delete fromAbbwhereCode=1CREATE TABLE ABC (nointPrimary Key Identity (1,1), name varchar ( -) notNULL, sex varchar ( -) notNULL, AgeintNotNULL, HighintNotNULL, [weight]intNotNULL, idintNotNULL, [address] varchar ( -) notNULL) Goinsert into ABC values ('John Doe','male', -,173, the,37030319,'Atlantis') INSERT INTO ABC values ('Little Two','female', +,163, -,37030319,'away from all the ideal township') INSERT INTO ABC values ('Harry','male', -,183, -,37030317,'Altolia') INSERT INTO ABC values ('Rachel','male', -,189, the,37039011,'San Andreas') INSERT INTO ABC values ('Xiao Huang','female', -,155, -,37099006,'Ancient Loulan') INSERT INTO ABC values ('Small Flower','female', -,161, -,37099307,'Alexander') Select* fromABC Delete fromabcupdate ABCSetName='Zhang San' whereName='John Doe';
Basic knowledge of the database