CREATE DATABASE s20150417 -- Create a database with a database name that is not a pure number
CREATE DATABASE Whirlpool Naruto
DROP Database Whirlpool Naruto -- Delete database
Use Whirlpool Naruto -- using the database
Go -- connector
CREATE TABLE Xuesheng -- Create a table
(
Code int Not null,
name varchar (+) Not null,
Sex int ,
degree decimal (18,2) not null
)
Go
Insert into Xuesheng Values (1,' Zhang Mowgli ', 1,99) --One by one corresponds to the add
Insert into Xuesheng (code,name,degree) Values (4,' Delmar ', 98) -- Specify item additions
Go
Select * from xuesheng-- querying all data in a table
Go
Update Xuesheng Set sex=0 --Modify the value of the sex column in all rows
UPDATE  xuesheng set sex =0 where code =1 --where Span style= "Font-family:times New Roman;" >code=1 sex
Update Xuesheng Set name=' Prince ',code=7,sex=1 where name=' Zhang Mowgli '-- to name= Zhang Mowgli's this line into name= ' Prince ', code=7 , Sex=1
Go
Delete from Xuesheng -- Delete all data
Delete from Xuesheng where Code=4 -- Delete This line of code=4
drop table Xuesheng -- Delete entire table
Database Basic Course