Basic knowledge of the database

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.