/**1.create Table guestbook**/
--if object_id (' guestbook ') is null
--create TABLE Guestbook (id int PRIMARY KEY, visitor VARCHAR (+), comments text,entrydate DATETIME)
/**2.insert Data into table guestbook**/
--insert into guestbook values (3, ' a ', ' 123 ', ' 2016-05-12 ')
--insert into guestbook values (4, ' a ', ' 1234 ', ' 2016-05-12 ')
--insert into guestbook values (5, ' a ', ' 12345 ', ' 2016-05-12 ')
/**3.drop Table guestbook**/
--if object_id (' guestbook ') is not null
--drop Table Guestbook
--IF exists (SELECT * from sysobjects where name= ' guestbook ')
--drop Table Guestbook
/**4.update Table guestbook**/
--update Guestbook Set visitor= ' B ' where id= ' 4 '
/**5.select All record**/
--select * FROM Guestbook
/**6.delete data (one record) from table guestbook**/
--delete Guestbook where id= ' 3 '
/**7.truncate Table Guestbook (delete all datas from table Guestbook) **/
--truncate Table Guestbook
This article comes from the "Ricky's blog" blog, please be sure to keep this source http://57388.blog.51cto.com/47388/1772705
SQL--Simple Sentence Learning Summary 7 article